opened form

  • Thread starter Thread starter Guest
  • Start date Start date
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.
 
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'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.
 
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.
 
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.
 
Back
Top