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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trying to open form and import field 2

Status
Not open for further replies.

dporrelli

Programmer
Dec 18, 2002
43
GB
I am trying to create a button which opens a form then takes the infrmation in 1 field from the existing form and inster it into the newly opened form (does this make sense?????). Here is the code that I used.

Dim stDocName As String
Dim stLinkCriteria As String
Dim faultno As String


faultno = Form_fault.Fault_Number
stDocName = "Current RMA"
DoCmd.OpenForm stDocName, , , stLinkCriteria
DoCmd.GoToRecord , , acNewRec
Form_Current_RMA.Fault_No = faultno

It works upto the point of creating new record, but after that I get an error "object required".

Any help would be great, thanks
 
Replace this:
Form_Current_RMA.Fault_No = faultno
By this:
Forms![Current RMA]!Fault_No = faultno

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
faultno = Form_fault.Fault_Number
stDocName = "Current RMA"
DoCmd.OpenForm stDocName, , , ,acFormAdd
Forms!Current_RMA.Fault_No = faultno

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top