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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Default values for fields

Status
Not open for further replies.

mfd777

Programmer
Sep 21, 1999
53
IE
I am trying to get a field to default to a value but I need to be able to overwrite that value. For example I have a customers table with a field called quantity.<br>
When I am entering data in the sales table I need the quantity field to default to the value of the quantity field for the customer but I also need to be able to change the quantity just for this sale if they want. If i do change the quantity for this sale I don't want to update the default quantity field in the customers table.<br>
If anyone has any ideas I would appreciate it.
 
Yes you have to ADD an additional unbound text box.<br>
and Hide the one that has the qty you don't want changed. <br>
Then in an Event usch as &quot;Open form&quot; or something where you get the qty have code that gets the qty form the hidden box. <br>
Such as Me![newfield] = me![FieldDontChange]<br>
Then you can change the values in the NEW box without affecting the underlying table.
 
You can use also add Dlookup function into QuantityWanted field's Default Value property to get the default quantity:<br>
<br>
Something like =Dlookup(&quot;[YourDefaultQuatityField]&quot;, &quot;[YourCustomersTable]&quot;,&quot;[YourCustomersTable].[YourCustomerTableCustomerField]=Me![YourFormsCustomerField&quot;)<br>
<br>
Good luck,<br>
Al<br>
<br>
Hint: Next time list your table names and fields so these function examples will be more meaningful (and shorter to write :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top