Field default value setting

G Marshall

Board Regular
Joined
Dec 31, 2002
Messages
134
Hello
I have an “orders” table that has a column for buying order numbers. There can be many orders using the same buying order number .

To save additional typing on the input form for this table, during data entry, I want the value of this field to default to the previous buying order number each time.

I would appreciate if someone could point me in the right direction as to what to enter in the field default value to achieve this.

Cheers

Gerald
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
Something like
Code:
Private Sub Orders_AfterUpdate()
Me.Orders.Tag = Me.Orders
End Sub
Private Sub Form_BeforeInsert(Cancel As Integer)
Me.Orders= Me.Orders.Tag
End Sub
shoud do it.

This does not actualy repeat the last order number in the recordset but saves the last one typed in.usualy the same in practice. Also you can bring up the previous entry with the kb short cut ctrl-'

HTH

Peter
 
Upvote 0

Forum statistics

Threads
1,221,771
Messages
6,161,847
Members
451,723
Latest member
Rachetsely

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top