Can't figure out why this is not working

A

Ayo

I have this OpenForm method that is giving a "The OpenForm action was
canceled" error message. And I can't figure out what this means.
Help Please.

DoCmd.OpenForm "frmSiteConfiguration", acNormal,
"qry_SiteConfiguration_GSM", datamode:=acFormEdit, _
wherecondition:="[SiteID]= '" & Me.SiteID & "'" & " And
[ProjectName]= '" & Me.ProjectName & "'", OpenArgs:="GSM850"
 
J

Jerry Whittle

First make sure that there is at least one record that can be returned
especially if you are talking a 2501 error.

Next simplify the code. Start by stripping out the OpenArgs and test. Does
it work now?

If not, then the WhereCondition. Maybe rebuild it with just one part then
the other until it works.

You might need to change the Me to the entire [Forms].[FormName].[FieldName].
 
A

Ayo

I din't have to build it part by part before. use to be I just type the
method and everything works fine

Jerry Whittle said:
First make sure that there is at least one record that can be returned
especially if you are talking a 2501 error.

Next simplify the code. Start by stripping out the OpenArgs and test. Does
it work now?

If not, then the WhereCondition. Maybe rebuild it with just one part then
the other until it works.

You might need to change the Me to the entire [Forms].[FormName].[FieldName].
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


Ayo said:
I have this OpenForm method that is giving a "The OpenForm action was
canceled" error message. And I can't figure out what this means.
Help Please.

DoCmd.OpenForm "frmSiteConfiguration", acNormal,
"qry_SiteConfiguration_GSM", datamode:=acFormEdit, _
wherecondition:="[SiteID]= '" & Me.SiteID & "'" & " And
[ProjectName]= '" & Me.ProjectName & "'", OpenArgs:="GSM850"
 
A

Ayo

Even this doesn't work:

DoCmd.OpenForm "frmSiteConfiguration", acNormal, OpenArgs:="GSM850" & "," &
Me.txtSiteID & "," & Me.txtProjectName & _
"," & Me.txtRevNumber & ",qry_SiteConfiguration_GSM"

but this does:

DoCmd.OpenForm "frmSiteConfiguration", acNormal, OpenArgs:="GSM850" & "," &
Me.txtSiteID & "," & Me.txtProjectName

Jerry Whittle said:
First make sure that there is at least one record that can be returned
especially if you are talking a 2501 error.

Next simplify the code. Start by stripping out the OpenArgs and test. Does
it work now?

If not, then the WhereCondition. Maybe rebuild it with just one part then
the other until it works.

You might need to change the Me to the entire [Forms].[FormName].[FieldName].
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


Ayo said:
I have this OpenForm method that is giving a "The OpenForm action was
canceled" error message. And I can't figure out what this means.
Help Please.

DoCmd.OpenForm "frmSiteConfiguration", acNormal,
"qry_SiteConfiguration_GSM", datamode:=acFormEdit, _
wherecondition:="[SiteID]= '" & Me.SiteID & "'" & " And
[ProjectName]= '" & Me.ProjectName & "'", OpenArgs:="GSM850"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top