Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Open form from another form and go to same record

Status
Not open for further replies.

labprof

Technical User
Jan 26, 2006
49
US
Can someone please .....Help?????

I have a form called CA_Act_frm that is based on a table called CA_tbl. The form opens in data entry mode and the first entry field is a combo box called Action_type.

I have an auto number field in the table called ActionNum
that assigns a number to the record.

I have another form called QB_Enter_frm that I need to open to input data into fields that are from the same table.

I have a checkbox field on the CA_Act_frm called Quality Bulletin. When it is checked I need the second form (QB_Enter_frm) to open and go to the existing or current record. The second form has fields on it that the first form doesn't need.

I hope I am being clear. I have tried many scenarios to get this to work without any luck.

Any help would be greatly appreciated.

Labprof
 
How about:

Code:
Private Sub Quality_Bulletin_AfterUpdate()
If Me.[Quality Bulletin] = True Then
    DoCmd.OpenForm "QB_Enter_frm", , , "ActionNum=" & Me.ActionNum
End If
End Sub

However, you will also need a command button or some other means of accessing this form, otherwise the user will be obliged to uncheck and check the checkbox to view the report.
 
How are ya labprof . . .
[blue]I have a checkbox field on the CA_Act_frm called Quality Bulletin. When it is checked [purple]I need the second form (QB_Enter_frm) to open and go to the existing or current record.[/purple][/blue]
For proper operation you need to save/commit the record in [blue]CA_Act_frm[/blue] before you open [blue]QB_Enter_frm![/blue]

[blue]Remou's[/blue] code is on target, it just doesn't include saving the current record in [blue]CA_Act_frm[/blue]:
Code:
[blue]   If Me.[Quality Bulletin] Then
      [purple][b]DoCmd.RunCommand acCmdSaveRecord[/b][/purple]
      DoCmd.OpenForm "QB_Enter_frm", , , "ActionNum=" & Me.ActionNum
   End If[/blue]
[blue]Your Thoughts? . . .[/blue]

Calvin.gif
See Ya! . . . . . .
 
Thank you guys....
This works, it took awhile for me to figure it out but
I got it.

Man I love this forum.

Thanks again Remou, and TheAceMan1

Labprof
 
I am trying to use this code in my form but

If Me.Expiration Then
DoCmd.RunCommand acCmdSaveRecord
DoCmd.OpenForm "ExpNotes", , , "ActionNum=" & Me.ActionNum
End If

where Expiration=the field that's checked and ExpNotes=the form to open.
The error is:"method or data member not found" with the ActionNum at the end of the line highlighted. Not sure what the ActionNum means. Any advice?

 
kbear . . .

Go over the thread initiation by [blue]labprof[/blue] . . .

Calvin.gif
See Ya! . . . . . .
 
If I understood that part, I wouldn't be asking the question. I tried to modify the code to fit my needs but I don't understand the ActionNum.
 

ActionNum is the unique ID for LabProf's records in his forms, what is yours?
 
Oh - I get it! IDMSA is the field name so I would want:

DoCmd.OpenForm "ExpNotes", , , "IDMSA=" & Me.IDMSA

Thank you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top