Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / February 2008

Tip: Looking for answers? Try searching our database.

Can't find field

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Walter - 11 Feb 2008 17:38 GMT
I have a user input form which opens in in dialog mode in the AfterUpdate
event of a control.  The user's selection sets the value of an option field
and the form's visible property to false.  When the code resumes to evaluate
the response, I'm getting the error "Microsoft Access can't find the field
'YesOption' referred to in your expression".  The option is being set as well
as the visible property.  Why is Access not recognizing it?
Calling Code:
DoCmd.OpenForm "frmUpdateDeliveryInformation", acNormal, , , , acDialog

If fIsLoaded("frmUpdateDeliveryInformation") = True Then
       If [Forms]![frmUpdateDeliveryInformation]![YesOption ] = True Then
           'Action to take
       End If
       DoCmd.Close acForm, "frmUpdateDeliveryInformation"
   Else
       ' if the form is not open, then user hit the "x", or the cancel
       ' button on the frmGetComboName form. Note that the cancel button on
       ' this form simply does a docmd.close
       MsgBox "user canceled"
   End If

Input Form Code:
Private Sub cmdYes_Click()
On Error GoTo Err_cmdYes_Click
   
   Me.YesOption = True
   Me.Visible = False

Exit_cmdYes_Click:
   Exit Sub

Err_cmdYes_Click:
   MsgBox Err.Description
   Resume Exit_cmdYes_Click
   
End Sub
Private Sub cmdNo_Click()
On Error GoTo Err_cmdNo_Click
   
   Me.YesOption = False
   Me.Visible = False

Exit_cmdNo_Click:
   Exit Sub

Err_cmdNo_Click:
   MsgBox Err.Description
   Resume Exit_cmdNo_Click
   
End Sub
Thanks!
Walter
Jeanette Cunningham - 11 Feb 2008 20:52 GMT
In the post you have a space at the end of YesOption  - [YesOption ]
If this is a copy paste of the code, you should be right if you remove that
space.

Jeanette Cunningham

>I have a user input form which opens in in dialog mode in the AfterUpdate
> event of a control.  The user's selection sets the value of an option
[quoted text clipped - 52 lines]
> Thanks!
> Walter
Walter - 12 Feb 2008 04:29 GMT
That was it!
Thanks!
Walter

> In the post you have a space at the end of YesOption  - [YesOption ]
> If this is a copy paste of the code, you should be right if you remove that
[quoted text clipped - 58 lines]
> > Thanks!
> > Walter
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.