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!

Adding records with form and subform

Status
Not open for further replies.

marcin2k

Programmer
Jan 26, 2005
62
CA
I need someone to get me started,
I have two tables:
tCon: tTrans:
ConID TransID
EnvNo EnvNo
Name Money
Desc

This is suppose to work like a bank account. I need to make a form with a subform so that I can type in an [EnvNo] in a textbox and in the subform it will display the [Name] and [Desc] for that EnvNo. That was the easy part because I got it to work the other part is that the main form has a textbox for [Money]. After a user types in an [EnvNo] and the information displays below in the subform, they can then type in the [Money] and press a commmand button. This is suppose to add a record to [tTrans] with the current [EnvNo] and that money. I got this to work but it only is able to add it once. If I was to press the command button again after adding one amount it just replaces the previous records money amount without adding a new record with a new transaction.

Please I need some help.
 
Hi
What is the code behind the command button? Does it have AddNew and such like?
 
WE presume you are moving to a new record once youv'e added the money before adding the next amount?

else it's a case of...

DoCmd.GoToRecord ,,Acnewrec
 
It seems to me that if you put the tTrans data in a subform linked by EnvNo and simply created an "add record" button on that subform it should work.
MrBill
 
DoCmd.GoToRecord i tried and it does not work, How do i set so that it adds a record in the tTrans table because the subform works on tCon table. So when I go to GoToRecord I think it probably gets confused.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top