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!

Save the record after a field is populated

Status
Not open for further replies.

kysterathome

Technical User
Dec 22, 2004
37
LU
Hi All,

How do I automatically save a record after a field has been populated?

The situation: I have a lookup btn in my frmData that pops up a frmSearch. Upon double clicking my choice is frmSearch, the last field in frmData (a combo box txtInfo) gets populated with the data I double-clicked in the frmSearch.

After this, I would like the frmData to save automatically. So far I have to use a btn to save record, but would like it to be done automatically...

Any ideas how I can achieve this?

Kysterathome
 
Hi

See DoCmd.RunCommand acCmdSaveRecord

but, be aware Access will save the record anyway when you close the form, and/or move off the record

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
How are ya kysterathome . . . . .

Or you could use:
Code:
[blue]   Me.Dirty = False[/blue]

Calvin.gif
See Ya! . . . . . .
 
KenReay,

I tried your idea on After Update, On Enter, On Change, but not working, it still only returns an empty result in frmData.

TheAceMan1, my VBA is quite poor still. Where/how do I apply your me.diry=false?

 
kysterathome . . . . .

Are you attempting to [blue]save the new list in the combobox?[/blue]

Calvin.gif
See Ya! . . . . . .
 
TheAceMan1

Actually, the user has the choice: either he choses a name in the dropdown in frmData, or he uses the frmSearch, which helps the search via a form. The name chosen in frmSearch (chosen among the same names that are in the dropdown list in frmData) will populate the dropdown list in frmData. Now, upon clicking the btnSend, the results of frmData will popluate the fields of another form. However, now, have to press btnSaveRecord prior to clicking btnSend, for the data to be transferred. And it is this btnSaveRecord that I would like to avoid.

Kysterathome
 
Ha! Of course, I got it....

Just insert

Code:
 DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70

Before the actual code for the submit button :)

Kysterathome
 
Hi

That is just the "old fashioned" version of DoCmd.RunCommand acCmdSaveRecord, which was superceded from Access97 on (I think from memory), anyway, same effect

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top