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!

Populating a control without creating a record

Status
Not open for further replies.

charlie12345

Technical User
Mar 4, 2001
28
US
I want to populate the ID field with a value the user has entered, without automatically creating a new record in the table.
If I set the control before I open the form (e.g. Forms!frmData.StoneID = Me!StoneID) the form automatically runs Update, and creates a record.
I've tried setting the 'Dirty' property to False, but that didn't help.
Suggestions?

Thanks,
Charlie
 
Well - the form shouldn't run an update only by populating a control, but entering a value in a bound control, would create a new record.

A workaround here, might be to populate an unbound control with your value,

[tt] Forms!frmData!txtTempStoneID.Value = Me!StoneID.Value[/tt]

and then on an appropriate event (for instance the forms before update?), assign this controls value to the control bound to the id field.

[tt]Me!txtStoneID.Value = Me!txtTempStoneID.Value[/tt]

Roy-Vidar
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top