Error message 2105

T

tankerman

I have a form "FrmAcq" with a subform "FrmAcqSub" parent chid link is
AcqPK-AcqFK. This work with no problem. I have a search form to find the
acquistion that I need , I enter a date frame in this form and it opens up in
spreadsheet view, in the AcqPK I have this code in the double click

DoCmd.OpenForm "FrmAcq", , , "AcqPK =" & Me.AcqPK

I get Error:2105 can not go the record but when I click OK it opens the
record I am looking for. I probably need some error handling and have tried
to put it in by viewing Allen Browne's site with not luck.

I should mention that the sub form is a continous form and ends up with
several AcqFK same as the AcqPK so I believe this is what is causing me the
problem.
 
B

banem2

I have a form "FrmAcq" with a subform "FrmAcqSub" parent chid link is
AcqPK-AcqFK. This work with no problem.   I have a search form to find the
acquistion that I need , I enter a date frame in this form and it opens up in
spreadsheet view, in the AcqPK I have this code in the double click

DoCmd.OpenForm "FrmAcq", , , "AcqPK =" & Me.AcqPK

I get Error:2105 can not go the record but when I click OK it opens the
record I am looking for. I probably need some error handling and have tried
to put it in by viewing Allen Browne's site with not luck.

I should mention that the sub form is a continous form and ends up with
several AcqFK same as the AcqPK so I believe this is what is causing me the
problem.

Is the AcqPK string or number? I assume it is number. If not, you need
additional single quotes in command:

DoCmd.OpenForm "FrmAcq", , , "AcqPK LIKE '" & Me.AcqPK & "'"

Regards,
Branislav Mihaljev
Microsoft Access MVP
 
T

tankerman

It is an Autonumbered field.

Is the AcqPK string or number? I assume it is number. If not, you need
additional single quotes in command:

DoCmd.OpenForm "FrmAcq", , , "AcqPK LIKE '" & Me.AcqPK & "'"

Regards,
Branislav Mihaljev
Microsoft Access MVP
 
B

banem2

It is an Autonumbered field.

Does error appears on each record or only on new record (not saved yet
when you try to open another form)?

Regards,
Branislav Mihaljev
Microsoft Access MVP
 

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