Duplicating a field from one form to another form

Marcus H

Registered User.
Local time
Today, 01:05
Joined
Nov 29, 2000
Messages
13
I have a 'quote form' and a 'new case form'. Before a new case a quote must be done. This quote is given a reference number. If it becomes a new case i select the refernce number from a lookup on my new case form. This then finds the correct record in my quote form. However certain fields i want to be automatically entered into the new case form from the quote form. Eg-on selecting refrence number 10 i want the name, address from the quote form to be entered into the name, address fields on my new caes form.
In code i have tried things like -
name = Forms![frmquote].name. Nothing seems to work though! Can anyone give me any ideas on how i can sipmply dupicate fields from one form to another??
 
In the first form, you want some code like this, at the point where you are opening the second form:

strDocName = "fSecondForm"
DoCmd.OpenForm strDocName, , , , acAdd
Forms![fSecondForm]![txtField1] = Me.txtField1
Forms![fSecondForm]![txtField2] = Me.txtField2
Forms![fSecondForm]![txtField3] = strSomethingelse 'some other thing I built in code
 

Users who are viewing this thread

Back
Top Bottom