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!

Pass the value 1

Status
Not open for further replies.

nat35

Programmer
Nov 10, 2002
86
AU
Hi there,
Could anyone help me.
I have subform based on tbl_contract and contractNo field
I have create a button open another newform based on tbl_rebate in subform
When I open a newform I want to be able add new record and
where contractNo will go into contractNo in tbl_rebate automaticly.
I am using access2000
and also could anyone recommend a good book for access2000
Thanks
Nat
 
Try some like this:

In the On Click Event Procedure of your existing Command Button write

DoCmd.OpenForm "FrmRebate", , , , acFormAdd, , contractNo

In FrmRebate (Rebate Form) write in Open Event Procedure

Me.contractNo.SetFocus
Me.contractNo = OpenArgs

Also you can set the Locked Property to True to prevent user modification

Good Luck
 
Thank you thank you thank you, You would get a million stars if I could put that many on here
 
how can i pass on 3 values instead of only 1? Not only contractNo as the example but date and customername as well?
 
Andyukcy:

The open argument field is a string, you can pass the value to the second form join the three fields in one.

The second option is declaring three Public Variable and set the value you want in that before open the new form.




 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top