Cannot Find field in Expression

phillbaker

Registered User.
Local time
Today, 06:38
Joined
Jun 29, 2008
Messages
45
i have a form with a button which should load another form using the following VB Code:

DoCmd.OpenForm "Incidents", acNormal, , "[Incidents.VIncdientID]=" & Me!VIncidentID
Form_Incidents.VIncidentID.DefaultValue = Me!VIncidentID

The form should then use a query to look for only those records based on VIncidentID but im getting an error come up when i press the button saying

Database can't find the field 'VIncidentID' referred to in your expression.

The form that the button should load up and is based on that query called Q_Incidents has two tables in it. A Clients and A incidents table linking from VIncidentID to ClientID and i have dragged the following fields down to the colums at the bottom for it to query on.

Incidents.*
CFirstname (from clients table)
CLastname (from clients table)
ClientID (from clients table)
VIncidentID(from incidents table)

what is it im doing wrong.
 
If that's a copy/paste, there are different spellings of the field name. Are they actually spelled differently?
 
no they arnt spelt differently that was a typo i made in the code which i have now corrected but its still bringing up the same error. I have repasted it below

DoCmd.OpenForm "Incidents", acNormal, , "[Incidents.VIncidentID]=" & Me!VIncidentID
Form_Incidents.VIncidentID.DefaultValue = Me!VIncidentID
 
What line does it stop on?
 
its stops on the first line if you mean after you click on debug: the line is pasted below:

DoCmd.OpenForm "Incidents", acNormal, , "[Incidents.VIncidentID]=" & Me!VIncidentID
 

Users who are viewing this thread

Back
Top Bottom