Access form field override

GreyFog

New Member
Joined
Oct 13, 2002
Messages
14
I have created a form with fields for part number and quantity that populate table "B". I want the field for quantity to display the current quantity listed for that part number from table "A". When the user opens the form, enters the part number then tabs to the quantity field they need to be able to accept the "default quantity" from table "A" or override it with a new quantity that will populate table "B". HELP! :eek:
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
Hi Greyfog,

I would use a query for this. Create a new query, and drag over table A and include the fields of interest. You will need a new field for 'optional'.

I think you would want something like

Table A
partNo/qty/optional(T/F)

You won't actually be writing over your standard quantity, Access doesn't really work like that. You have to store both numbers (standard/optional). The field 'useoption' will determine which quantity to go with.

Your query should display all records from TableA (you must narrow this down using criteria).

If you base a form of this query, and have the criteria for this query look to a text box on the form, you can enter a part number (you'll need to add a requery action to the textbox on_change event to keep the form fresh) and have a listbox, or datasheet display the part number's qunatity. I think you will need a button that says something like 'add optional qty', and when clicked, creates a new record, checks optional, and sets the part number to the number in the text box. Now you have a blank field for quantity, and when filled, you will have a new record with quantity, optional = true, and the part number, which I think will cover your bases.

HTH,
 
Upvote 0

Forum statistics

Threads
1,221,525
Messages
6,160,327
Members
451,637
Latest member
hvp2262

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