opened form

G

Guest

I have trying to figure this out for weeks now. It's driving me crazy. I
have a form with a sub form and on the subform is a command button to open a
second form. in the event procedure i have:
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
DoCmd.OpenForm "frmDARPAeval", acNormal, "", "[BAA/RFP/RFI
Number]=[Forms]![frmInfoEval2]![BAA/RFP/RFI Number] And
[Subject]=[Forms]![frmInfoEval2]![Subject] And [Candidate
Technology]=[Forms]![frmInfoEval2]![Candidate Technology]", , acNormal

However, this isn't working. When the second form opens, i get ######### in
the fileds that are supposed to match. What do i do? I just want to be able
to save the information on the subform so that i can open the second form
based on that information.
 
J

Joshua A. Booker

Brandie,
You need to include quotes around text values. Assuming the first field is
truly a number and not a text field, try this:

DoCmd.OpenForm "frmDARPAeval", acNormal, "", "[BAA/RFP/RFI
Number]=[Forms]![frmInfoEval2]![BAA/RFP/RFI Number] And
[Subject]='" & [Forms]![frmInfoEval2]![Subject] & "' And [Candidate
Technology]='" & [Forms]![frmInfoEval2]![Candidate Technology] & "'", ,
acNormal

HTH,
Josh
 
G

Guest

I've tried that as well. The problem with that is that the subform isn't
saved in the table so it is simply opening a new empty form instead of the
one that matches. If I can save the info on the subform to the table in some
way before opening the second form, then i think it will work. And, FYI: the
BAA/RFP/RFI number is a text field.

Joshua A. Booker said:
Brandie,
You need to include quotes around text values. Assuming the first field is
truly a number and not a text field, try this:

DoCmd.OpenForm "frmDARPAeval", acNormal, "", "[BAA/RFP/RFI
Number]=[Forms]![frmInfoEval2]![BAA/RFP/RFI Number] And
[Subject]='" & [Forms]![frmInfoEval2]![Subject] & "' And [Candidate
Technology]='" & [Forms]![frmInfoEval2]![Candidate Technology] & "'", ,
acNormal

HTH,
Josh

Brandie said:
I have trying to figure this out for weeks now. It's driving me crazy. I
have a form with a sub form and on the subform is a command button to open a
second form. in the event procedure i have:
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
DoCmd.OpenForm "frmDARPAeval", acNormal, "", "[BAA/RFP/RFI
Number]=[Forms]![frmInfoEval2]![BAA/RFP/RFI Number] And
[Subject]=[Forms]![frmInfoEval2]![Subject] And [Candidate
Technology]=[Forms]![frmInfoEval2]![Candidate Technology]", , acNormal

However, this isn't working. When the second form opens, i get ######### in
the fileds that are supposed to match. What do i do? I just want to be able
to save the information on the subform so that i can open the second form
based on that information.
 
J

Joshua A. Booker

Brandie,

If access can't figure out the criteria it may open a blank form. Your code
apears to be saving the record properly. Because the first field is also
text try this:

DoCmd.OpenForm "frmDARPAeval", acNormal, "", "[BAA/RFP/RFI
Number]='" & [Forms]![frmInfoEval2]![BAA/RFP/RFI Number] & "' And
[Subject]='" & [Forms]![frmInfoEval2]![Subject] & "' And [Candidate
Technology]='" & [Forms]![frmInfoEval2]![Candidate Technology] & "'", ,
acNormal

HTH,
Josh

Brandie said:
I've tried that as well. The problem with that is that the subform isn't
saved in the table so it is simply opening a new empty form instead of the
one that matches. If I can save the info on the subform to the table in some
way before opening the second form, then i think it will work. And, FYI: the
BAA/RFP/RFI number is a text field.

Joshua A. Booker said:
Brandie,
You need to include quotes around text values. Assuming the first field is
truly a number and not a text field, try this:

DoCmd.OpenForm "frmDARPAeval", acNormal, "", "[BAA/RFP/RFI
Number]=[Forms]![frmInfoEval2]![BAA/RFP/RFI Number] And
[Subject]='" & [Forms]![frmInfoEval2]![Subject] & "' And [Candidate
Technology]='" & [Forms]![frmInfoEval2]![Candidate Technology] & "'", ,
acNormal

HTH,
Josh

Brandie said:
I have trying to figure this out for weeks now. It's driving me crazy. I
have a form with a sub form and on the subform is a command button to open a
second form. in the event procedure i have:
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
DoCmd.OpenForm "frmDARPAeval", acNormal, "", "[BAA/RFP/RFI
Number]=[Forms]![frmInfoEval2]![BAA/RFP/RFI Number] And
[Subject]=[Forms]![frmInfoEval2]![Subject] And [Candidate
Technology]=[Forms]![frmInfoEval2]![Candidate Technology]", , acNormal

However, this isn't working. When the second form opens, i get
#########
in
the fileds that are supposed to match. What do i do? I just want to
be
able
to save the information on the subform so that i can open the second form
based on that information.
 
G

Guest

It does save it but the second form doesn't get those control values filled
in. SO when i close it I get the whole duplicaiton error thing. How do i
fix it?


Joshua A. Booker said:
Brandie,

If access can't figure out the criteria it may open a blank form. Your code
apears to be saving the record properly. Because the first field is also
text try this:

DoCmd.OpenForm "frmDARPAeval", acNormal, "", "[BAA/RFP/RFI
Number]='" & [Forms]![frmInfoEval2]![BAA/RFP/RFI Number] & "' And
[Subject]='" & [Forms]![frmInfoEval2]![Subject] & "' And [Candidate
Technology]='" & [Forms]![frmInfoEval2]![Candidate Technology] & "'", ,
acNormal

HTH,
Josh

Brandie said:
I've tried that as well. The problem with that is that the subform isn't
saved in the table so it is simply opening a new empty form instead of the
one that matches. If I can save the info on the subform to the table in some
way before opening the second form, then i think it will work. And, FYI: the
BAA/RFP/RFI number is a text field.

Joshua A. Booker said:
Brandie,
You need to include quotes around text values. Assuming the first field is
truly a number and not a text field, try this:

DoCmd.OpenForm "frmDARPAeval", acNormal, "", "[BAA/RFP/RFI
Number]=[Forms]![frmInfoEval2]![BAA/RFP/RFI Number] And
[Subject]='" & [Forms]![frmInfoEval2]![Subject] & "' And [Candidate
Technology]='" & [Forms]![frmInfoEval2]![Candidate Technology] & "'", ,
acNormal

HTH,
Josh

I have trying to figure this out for weeks now. It's driving me crazy. I
have a form with a sub form and on the subform is a command button to
open a
second form. in the event procedure i have:
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
DoCmd.OpenForm "frmDARPAeval", acNormal, "", "[BAA/RFP/RFI
Number]=[Forms]![frmInfoEval2]![BAA/RFP/RFI Number] And
[Subject]=[Forms]![frmInfoEval2]![Subject] And [Candidate
Technology]=[Forms]![frmInfoEval2]![Candidate Technology]", , acNormal

However, this isn't working. When the second form opens, i get #########
in
the fileds that are supposed to match. What do i do? I just want to be
able
to save the information on the subform so that i can open the second form
based on that information.
 

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

Similar Threads

Am I missing something? 12
ReQuery but stay on selected record - Please Help! 2
why do I get an error 1
Filtered records 3
Access 1
Problem Closing Forms. 2
Lost Focus of Form 1
Save n Refresh New Form 1

Top