Info on onone form into another

O

Owen

Hello,

I have a form called FCN's and a form called FWTickets. FCN's displays info
on a problem and FWTickets displays the cost of that problem. I open
FWtickets with a command button on FCN's.

When I enter a new FCN, a unique number is generated and put into txtFCNNUM.
I'd like to have that same number put into txtFWFCNNUM on the FWTickets from
when I open the form FWTTickets to add a new cost.

Can I do that?

TIA

Owen
 
S

Stefan Hoffmann

hi Owen,
When I enter a new FCN, a unique number is generated and put into txtFCNNUM.
I'd like to have that same number put into txtFWFCNNUM on the FWTickets from
when I open the form FWTTickets to add a new cost.
Can I do that?
Use the OpenArgs parameter of DoCmd.OpenForm:

Private Sub cmdOpenFwTickets()

DoCmd.OpenForm "FwTickets",,,,, CLng(txtFWFCNNUM.Value)
' or
' If Dirty Then Dirty = False
' DoCmd.OpenForm "FwTickets",,,,,Me![FWFCNNUM]

End Sub


In the open event of FwTicket:

Private Sub Form_Open(Cancel As Integer)

Dim ID As Long

ID = Nz(OpenArgs, -1)

' Use your ID...

End Sub


mfG
--> stefan <--
 
O

Owen

Stefan,

Thanks, that worked great. How can I insert another bit of data from a
different textbox? I also have a box called FCNJOBNUM that I would like to
autofill into FWJOBNUM on the FWTickets form.

Stefan Hoffmann said:
hi Owen,
When I enter a new FCN, a unique number is generated and put into txtFCNNUM.
I'd like to have that same number put into txtFWFCNNUM on the FWTickets from
when I open the form FWTTickets to add a new cost.
Can I do that?
Use the OpenArgs parameter of DoCmd.OpenForm:

Private Sub cmdOpenFwTickets()

DoCmd.OpenForm "FwTickets",,,,, CLng(txtFWFCNNUM.Value)
' or
' If Dirty Then Dirty = False
' DoCmd.OpenForm "FwTickets",,,,,Me![FWFCNNUM]

End Sub


In the open event of FwTicket:

Private Sub Form_Open(Cancel As Integer)

Dim ID As Long

ID = Nz(OpenArgs, -1)

' Use your ID...

End Sub


mfG
--> stefan <--
 
S

Stefan Hoffmann

hi Owen,
Thanks, that worked great. How can I insert another bit of data from a
different textbox? I also have a box called FCNJOBNUM that I would like to
autofill into FWJOBNUM on the FWTickets form.
If you only need the information from one form then i would read it from it:

Private Sub cmdOpenFwTickets()

DoCmd.OpenForm "FwTickets"

End Sub


In the open event of FwTicket:

Private Sub Form_Open(Cancel As Integer)

Dim ID As Long

ID = Forms!OtherForm.Form.ControlName.Value

End Sub


mfG
--> stefan <--
 
Top