Results 1 to 7 of 7
  1. #1
    Join Date
    May 2003
    Location
    Teas
    Posts
    28

    Unanswered: Can someone Audit a Form for me??

    Hello,

    Form works in sample database but not in real database......

    Same function is working for one form but not working for another form.

    I have a form that should roll over data to new record. There are two database that in the zip file. The CopyFormBDataToFormA.mdb is working. I used the same method for findrecord.mdb but is not working.

    CopyFormBDataToFormA.mdb (form name: FormA and FormB)
    Findrecord.mdb (form Name: frmRollOverGroup and frmRollOverGroupB)

    CAN ANYONE PLEASE HELP ME FIND OUT THE PROBLEM? Also, I did check the reference and it's the same.

    PROMPT RESPOND WILL BE APPRECIATED.
    Last edited by cool_guy_no_1; 09-16-03 at 01:20.

  2. #2
    Join Date
    May 2003
    Location
    Teas
    Posts
    28

    CAN ANYONE PLEASE HELP...

    ANY HELP....PLEASE. ALL THE WORK IS DONE. JUST WANT SOMEONE TO LOOK AT IT B/C SOMETIME OTHER PEOPLE CAN AUDIT BETTER. THANKS.

  3. #3
    Join Date
    Sep 2002
    Location
    Land of OZ
    Posts
    173

    Re: CAN ANYONE PLEASE HELP...

    Originally posted by cool_guy_no_1
    ANY HELP....PLEASE. ALL THE WORK IS DONE. JUST WANT SOMEONE TO LOOK AT IT B/C SOMETIME OTHER PEOPLE CAN AUDIT BETTER. THANKS.

    Hi Cool_Guy_No_1,

    I have had a look at your database. There are some issues with your code that has resulted in it not working.

    In regards to the one that is working, it is a simple table with all information completed.

    Here are the issues that you are having in your db.

    Some of your labels have the same name as a control source. This is a problem as when you write VBA ie.

    sPlan_Name = Plan_Name

    the line of code looks for a control by the name of Plan_Name NOT A CONTROL THAT HAS A CONTROL SOURCE AS PLAN_NAME. When it does not find a control by the name of PLAN_NAME, it then looks at control source.

    All of your controls have different names from your control sources. Would have been much easier to leave the name the same as the control source. IE. The Plan_Name textbox should have the name Plan_Name as the Name ans Control Source.

    Having mentioned this, you will notice that the label for Plan_Name has the name Plan_Name. Hence when the line of code

    sPlan_Name = Plan_Name

    runs, it is attempting to read the value of a label.... won't work.

    Problem No two, you are not doing a null check on any controls. You will notice that if a textbox has no content, it will fall over. I suggest that you change

    sPlan_Name = Plan_Name

    to

    If Not IsNull(Plan_Name) Then sPlan_Name = Plan_Name

    Problem no 3 is that you error handlers don't work, as your

    MsgBox Me.Name, "bDuplicate_Click", Err.Number, Err.Description

    is incorrect syntax. A msgbox has 3 arguments, separated by a comma.

    Hope that this was of some help. Sorry to be the bearer of bad tidings. I would be more than happy to fix most of this for you, but I will need about two days as I am going on two days break and coming back on the weekend to work ... quiter in the office on the weekend.
    Mona
    ________________________________
    Life is too short to be sane or sensible. Weird people rule and normal people suck

  4. #4
    Join Date
    May 2003
    Location
    Teas
    Posts
    28

    Here is the new database...

    check out the newly implemented database.

    Still Problem....
    Hi Mona,

    OK, I have implemented your suggessions. Now when I click "Process Roll Over" nothing happens. Any new suggessions. ALSO, THANKS FOR HELPING ME. I DON'T MIND WAITING TWO DAYS.

    THANKS
    DIANNA
    Last edited by cool_guy_no_1; 09-16-03 at 01:21.

  5. #5
    Join Date
    Sep 2002
    Location
    Land of OZ
    Posts
    173

    Re: Here is the new database...

    Originally posted by cool_guy_no_1
    check out the newly implemented database.

    Still Problem....
    Hi Mona,

    OK, I have implemented your suggessions. Now when I click "Process Roll Over" nothing happens. Any new suggessions. ALSO, THANKS FOR HELPING ME. I DON'T MIND WAITING TWO DAYS.

    THANKS
    DIANNA
    Hi Dianna,

    You have addresses problem one, however problem 2 and 3 need to be addressed. I will work on the db in two days time and let you know.

    Mona
    Mona
    ________________________________
    Life is too short to be sane or sensible. Weird people rule and normal people suck

  6. #6
    Join Date
    May 2003
    Location
    Teas
    Posts
    28

    works ..

    It's now working after struggling for few days and with Mona's help. However, I am working on logic. like force entry if a field left blank.

    Let me know if anyone need a sample copy.

    Thanks / Dianna

  7. #7
    Join Date
    Sep 2002
    Location
    Land of OZ
    Posts
    173

    Re: works ..

    Originally posted by cool_guy_no_1
    It's now working after struggling for few days and with Mona's help. However, I am working on logic. like force entry if a field left blank.

    Let me know if anyone need a sample copy.

    Thanks / Dianna
    Hi Dianna,

    If you want to ensure that there is data in every control.... on the button click add the following to the Process Button on FormA

    Dim ctrl

    For Each ctrl In Me.Controls
    If ctrl.Type = acTextBox Or ctrl.Type = acComboBox Or ctrl.Type = acListBox Then
    If ctrl.Value = "" Or IsNull(ctrl) Then
    MsgBox "Please complete all fields"
    ctrl.SetFocus
    Exit Sub
    End If
    End If
    Next

    This will esure that all field have been completed prior to processing ....

    Hope that this helps.
    Mona
    ________________________________
    Life is too short to be sane or sensible. Weird people rule and normal people suck

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •