Results 1 to 11 of 11
  1. #1
    Wayne311 is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2011
    Posts
    91

    Navigation form

    I have created forms with subforms which have some objects that have VB, such as:


    Private Sub Command10_Click()
    'On Error GoTo Err_Calculate_Click
    'MsgBox (Forms(Me.Parent.Name).Controls("RcptCRDistrict Subform1").Form!RcptNumber)
    If IsNull(Forms(Me.Parent.Name).Controls("RcptCRDistr ict Subform1").Form!RcptNumber) = True Then
    MsgBox ("Enter Last Name") 'Me.Text8 = 0
    Forms(Me.Parent.Name)!CarrierLName.SetFocus
    Exit Sub


    End If
    Me.Text8 = DSum("Charge", "RcptCRDistrict", "[RcptNumber] = " & Forms(Me.Parent.Name).Controls("RcptCRDistrict Subform1").Form!RcptNumber)
    Me.Refresh
    'Exit_NewCaseNumber_Click:
    'Err_Calculate_Click:
    'MsgBox Err.Description
    'Resume Exit_Calculate_Click
    End Sub

    They work great, until I created a navigation form, and now none of the VB works. I assume that now the navigation form is the parent, the former parent is now the subform, and the subform is what? Should I create the forms on the navigation form first from now on to avoid having to change VB based objects?

    Thanks
    Wayne

  2. #2
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    doesn't make sense, Wayne. I see you're using the code that I gave you the other day. good for you!

    still...nav form? seperate? obviously there's a main and a sub, but the nav? part of the main as well? without stuff like that, people are going to stare at this post and go..."hmmm...ok..."

  3. #3
    Wayne311 is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2011
    Posts
    91
    Hey Adam,

    Now you confuse me. The attached files show the navagation form where the buttons "New Case #" and "Calculate" don't work. The error says it can't find the main form. But in the Rct form they do work.

    Wayne

  4. #4
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    i tested it to be sure, wayne.

    tabs didn't make a difference for me. aren't those what's on that one pic of yours? it's 2 tabs on one form, right? if so, and all controls have same names, it should work.

    what's happening? you didn't tell us that.

  5. #5
    Wayne311 is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2011
    Posts
    91
    Quote Originally Posted by Wayne311 View Post
    The error says it can't find the main form.
    Wayne
    Now it is just acting strange. It occasionally does the calculation, but mostly not. It sees an empty field as not empty....just bizarre stuff.

    Wayne

  6. #6
    Wayne311 is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2011
    Posts
    91
    This is the most common occurance.

  7. #7
    Wayne311 is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2011
    Posts
    91
    The bizarre behavior was on the Nav form while the other form was open as well. With just the Nav form open it get the error shown above.

  8. #8
    Wayne311 is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2011
    Posts
    91
    I get this error with the "Calculate" button and the previous error with the "New Case #" button.

  9. #9
    Wayne311 is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2011
    Posts
    91
    This is how I created the navigation form: http://office.microsoft.com/en-us/vi...613.aspx?CTT=1

  10. #10
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    obviously it's missing that ref, Wayne. So somehow, somewhere, a control that has the word "rcptData" in it is not in the right place, has the wrong name, or is referenced incorrectly in code.

    that's exactly what the message says, thought it doesn't give you the options that I did.

  11. #11
    Wayne311 is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2011
    Posts
    91
    I think I got it figured out:

    If IsNull(Forms(Me.Parent.Name).Controls("RcptCRDistr ict Subform1").Form!CRNumber) = False Then ***use this if no Navigation Form
    If IsNull([Forms]![Navigation Form]![NavigationSubform].Controls("RcptCRDistrict Subform1").Form!CRNumber) = False Then '***use this with Navigation Form

    Any bets?

    Wayne

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

Similar Threads

  1. navigation form problem
    By stelioshania in forum Forms
    Replies: 1
    Last Post: 02-06-2011, 11:48 AM
  2. Replies: 2
    Last Post: 01-27-2011, 08:04 AM
  3. Replies: 2
    Last Post: 01-15-2011, 10:56 AM
  4. Cancel form navigation event
    By tuna in forum Forms
    Replies: 3
    Last Post: 08-15-2010, 01:46 PM
  5. Replies: 0
    Last Post: 12-12-2009, 04:45 PM

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