Advertisement

02.19.2008 at 02:10PM PST, ID: 23175889
[x]
Attachment Details

Forms Insert problem w/ AutoNumber

Asked by BluewingDigital in Access Forms, Microsoft Access Database, Access Coding/Macros

Tags: Microsoft, Access, 2007, Forms & VBA, Access VBA

I'm currently working on a small custom database for some specialized auctions.  The auctioneer may sell one, or multiple items at a single price.  In fact, during the middle of bidding, he may add items to the currently in progress auction lot to get the price up.

My database is setup to handle this part of the process using 3 tables.

Auctions_Lots
--LotID   Autonumber; PK
--AuctionID
--Price

Auctions_Lots_Items
--LotID  PK
--ItemCode  PK
--Quantity

Auctions_Lots_Buyers
--LotID  PK
--BidderID  PK
--Quantity

When the auction is happening, the user needs to be able to input the data quickly from one single form.  Then the user needs to be able to start the next lot, etc without changing forms.  I have this built.  I have one master form that uses the Auctions_Lots table and two child subforms that use the Auctions_Lots_Buyers and Auctions_Lots_Items tables.  These link to the Auctions_Lots table using the LotID field.

When the user loads the form, it automatically sets it to add record mode for the master form.  I have the three fields from Auctions_Lots on the form and the Price field defaults to 0.  Problem is, I can't get it to populate the LotID field automatically when the form loads.  The user MUST manually enter a price to get it to generate the autonumber for that field.  Unless they do, they can't enter data into the other subforms as the subforms don't know what value to set the LotID field to.

I have tried using DOCMD.Save or Me.Refresh to save the record using the $0 value when the form opens, activates, etc and can't figure it out.  Any advice would be greatly appreciated.

Thanks,

ChrisStart Free Trial
 
Loading Advertisement...
 
[+][-]02.19.2008 at 02:13PM PST, ID: 20933171

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02.19.2008 at 02:22PM PST, ID: 20933231

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02.19.2008 at 02:31PM PST, ID: 20933284

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Access Forms, Microsoft Access Database, Access Coding/Macros
Tags: Microsoft, Access, 2007, Forms & VBA, Access VBA
Sign Up Now!
Solution Provided By: DatabaseMX
Participating Experts: 1
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628