Before Update help

stevemccauley

Registered User.
Local time
Today, 23:48
Joined
Aug 8, 2001
Messages
75
I have 1 form that records transactions. If it is opened from "FormA", then I want the textbox "RefNbrA" on formA to be recorded to my transactions form, If it is opened from "FormB", then I want the textbox "RefNbrB" on FormB to be recorded to my transaction form.

How can I do this?
 
Use the OpenArgs property to determine which form opened your trans form.

Or

Create a global variable that gets set on just before you open the Trans form.
 
How do I use OpenArgs to determine with form opened my transaction form? Can you get me an example?
 
I'm assuming that Forms A and B remains open when the transaction form is opened:

On the event that opens the transaction form from Form A:

DoCmd.openform "transactionform",,,,,,1

On the event that opens the transaction form from Form B:

DoCmd.openform "transactionform",,,,,,2

On the OnOpen event of the transaction form

If Not IsNull (Me.openargs) then
Select Case Me.openargs

case 1

Me.fieldontransactionform = Forms!transactionform![RefNbrA]

Case 2

Me.fieldontransactionform = Forms!transactionform![RefNbrB]

End Select
End if

Give that a go and see how you get on. Come back if you're stuck.
 

Users who are viewing this thread

Back
Top Bottom