Results 1 to 11 of 11
  1. #1
    bsunuwar is offline Novice
    Windows XP Access 2003
    Join Date
    Mar 2011
    Posts
    4

    Red face Check dosent update current date


    Hi Everyone,


    I have a problem with my access 2003 subform where I have created a check for to update weather the address is checked or not in recent days and it should automatically show the current date on the other text box. The dilemma I am is now is that I have separate subform for different organisation which works fine and I have done in same procedure but it didn`t work on new one and diplays message " Address list cant find the form ...... referred to in the macro expression or visual basic code ". I also created separate macro called currentdateupdate with no luck. I dont know much about macro but tried to replicated from the previous one as going throughly how its made. Please help me.

    Thanks

  2. #2
    pkstormy's Avatar
    pkstormy is offline Access/SQL Server Expert
    Windows XP Access 2003
    Join Date
    Mar 2010
    Location
    Madison
    Posts
    682
    Can you upload an example? Having a separate subform 'for organization' doesn't sound right.

  3. #3
    bsunuwar is offline Novice
    Windows XP Access 2003
    Join Date
    Mar 2011
    Posts
    4
    HI pkstormy,

    Sorry, for not be able to clearly explain in words I have uploaded the picture of my current form so that it will be clear. My problem is when checked on the tight check box it should update the text box on the left with current date. Please click here to see Image = http://postimage.org/image/1my8margk/




    Thanks,

  4. #4
    bsunuwar is offline Novice
    Windows XP Access 2003
    Join Date
    Mar 2011
    Posts
    4
    HI pkstormy,

    Sorry, for not be able to clearly explain in words I have uploaded the picture of my current form so that it will be clear. My problem is when checked on the tight check box it should update the text box on the left with current date. Please click here to see the Image http://postimage.org/image/1my8margk/



    Thanks

  5. #5
    pkstormy's Avatar
    pkstormy is offline Access/SQL Server Expert
    Windows XP Access 2003
    Join Date
    Mar 2010
    Location
    Madison
    Posts
    682
    I'd first rename the macro (without a space). I'm not sure how many subforms you have designed (it didn't look like a subform but instead a form) but something to keep in mind is that if you find yourself designing 2, 3 or more forms based on the exact same data table (and you're updating the exact same data), it might be a better idea having a 'fiter' type field on 1 form to filter the different records. It's easier to maintain 1 form and coding than it is 3+ forms and any coding.

    I'd personally rename the macro if<space>me to ifMe or something without a space.

    If all your other subforms work except this one, it's most like a spelling error (ie. macro name as the error indicates - ie it can't find if<space>me.) or there is something within the macro that refers the Address Lists field to another macro (check each macro to make sure it isn't form specific and calling another macro.)

    I personally avoid macros even though years and years ago I used them all the time. Once I found I could do twice as much with vba coding and the coding is much easier (especially writing functions which can be called from anywhere), I never use macros anymore.

    Otherwise, can you post what the code is behind the Address Lists and explain that field a little more? (i'd also consider renaming Address<space>Lists without a space as well.)

  6. #6
    bsunuwar is offline Novice
    Windows XP Access 2003
    Join Date
    Mar 2011
    Posts
    4
    Hi pkstormy,

    Thank you very much for suggestion and I appreciate your thought but I have little knowledge with macro and VBA as well so, as you have mentioned I am pasting all vba codes:-

    Option Compare Database
    Option Explicit

    Sub Combo47_AfterUpdate()
    ' Find the record that matches the control.
    Me.RecordsetClone.FindFirst "[IDNo] = " & Me![Combo47]
    Me.Bookmark = Me.RecordsetClone.Bookmark
    End Sub

    Sub Combo49_AfterUpdate()
    ' Find the record that matches the control.
    Me.RecordsetClone.FindFirst "[IDNo] = " & Me![Combo49]
    Me.Bookmark = Me.RecordsetClone.Bookmark
    End Sub

    Private Sub Check17165_AfterUpdate()
    If Me.[Check17165] = True Then
    Me.[DateAddressCheck] = Date

    End If

    End Sub

    Private Sub Check17165_Click()

    End Sub

    Sub Command16872_Click()
    On Error GoTo Err_Command16872_Click


    DoCmd.GoToRecord , , acPrevious

    Exit_Command16872_Click:
    Exit Sub

    Err_Command16872_Click:
    MsgBox Err.Description
    Resume Exit_Command16872_Click

    End Sub
    Sub Command16873_Click()
    On Error GoTo Err_Command16873_Click


    DoCmd.GoToRecord , , acNext

    Exit_Command16873_Click:
    Exit Sub

    Err_Command16873_Click:
    MsgBox Err.Description
    Resume Exit_Command16873_Click

    End Sub
    Sub Command16886_Click()
    On Error GoTo Err_Command16886_Click


    DoCmd.Close

    Exit_Command16886_Click:
    Exit Sub

    Err_Command16886_Click:
    MsgBox Err.Description
    Resume Exit_Command16886_Click

    End Sub
    Sub Command16887_Click()
    On Error GoTo Err_Command16887_Click


    DoCmd.Close

    Exit_Command16887_Click:
    Exit Sub

    Err_Command16887_Click:
    MsgBox Err.Description
    Resume Exit_Command16887_Click

    End Sub

    Private Sub Text17152_BeforeUpdate(Cancel As Integer)

    End Sub

    Private Sub Text17152_Click()

    End Sub

  7. #7
    pkstormy's Avatar
    pkstormy is offline Access/SQL Server Expert
    Windows XP Access 2003
    Join Date
    Mar 2010
    Location
    Madison
    Posts
    682
    Sorry - I assumed this was a macro from the error message. Someone else though is going to need to step in here. I don't use the me.recordsetclone method.

    What I do instead of this:
    Me.RecordsetClone.FindFirst "[IDNo] = " & Me![Combo47]
    Me.Bookmark = Me.RecordsetClone.Bookmark

    is something like this:
    me.IDNo.setfocus
    docmd.findrecord me!Combo47

    I can't tell you if this would help for your situation or not. You may also want to consider adding a 'Refresh' command in the code before or after the recordsetclone command. And also adding in a 'Refresh' command after the me.DateAddressCheck = Date.

  8. #8
    pkstormy's Avatar
    pkstormy is offline Access/SQL Server Expert
    Windows XP Access 2003
    Join Date
    Mar 2010
    Location
    Madison
    Posts
    682
    I thought your picture though referenced a macro it couldn't find called if_me (I looked at the picture again.) I'm thinking now that there's something either in a control or somewhere where there's an "if" statement that is not completed. Did any errors show up when you debugged/compiled the code?

  9. #9
    pkstormy's Avatar
    pkstormy is offline Access/SQL Server Expert
    Windows XP Access 2003
    Join Date
    Mar 2010
    Location
    Madison
    Posts
    682
    Also, is there a control (or conditional formatting on a control) somewhere on the form which references 'Address List' which might have an 'If me.' code in it which isn't complete or references a control that doesn't exist on the form? This would seem to make more sense and the code is thinking it needs to look for a macro by that name. I'm also thinking 'Address List' is part of some coding on a control somewhere. I'd also double-check/compare all the event procedures of each control to see if there's anything that is not an [Event Procedure] that might have something like 'Address List.If me' in it.

    I hope this helps. Please post back on what you find. I'm curious.

  10. #10
    pkstormy's Avatar
    pkstormy is offline Access/SQL Server Expert
    Windows XP Access 2003
    Join Date
    Mar 2010
    Location
    Madison
    Posts
    682
    One last thing I just thought of you can do to help troubleshoot. After the msgbox err.description, I might add a msgbox "I errored on the command_xxxxx routine".

  11. #11
    pkstormy's Avatar
    pkstormy is offline Access/SQL Server Expert
    Windows XP Access 2003
    Join Date
    Mar 2010
    Location
    Madison
    Posts
    682
    I've seen this kind of error when the code got corrupted. You can try creating a new mdb file and importing all the objects. Make sure to debug/compile the code after importing.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Current Record Update Issue
    By SALPBE in forum Programming
    Replies: 0
    Last Post: 02-23-2011, 03:02 PM
  2. SQL Inner Join where date = current date
    By Tyork in forum Queries
    Replies: 2
    Last Post: 11-07-2010, 02:07 PM
  3. Comparing Date with current Date
    By ds_8805 in forum Forms
    Replies: 7
    Last Post: 03-31-2010, 09:31 PM
  4. Replies: 9
    Last Post: 03-19-2010, 10:37 AM
  5. Current Date Error
    By McFly in forum Database Design
    Replies: 4
    Last Post: 02-04-2010, 09:08 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums