Using list box adds blank record to lookup table

  • Follow


Hello, I have a form (frmpurchases) based on a query.  My query is based on 
two tables. tblPurchases (master table) and tblItems (lookup table describing 
the item category).  The field link between the two tables is the field 
called Items.

On frmPurchases, there is a list box for selecting the type of Item. which 
once selected, autofills various other fields with the Items details.  
Everything seems to work fine and I have no problem adding records etc.  The 
one glitch I can't figure out, is everytime I add a new purchase using 
frmpurchases and select the Item(list box), when I go out of the database and 
come back in, there is a new blank record in my TblItems for every new 
purchase I entered. So if I select the list box again, there will be blanks 
in the list for every new record.

How can I prevent my lookup table from adding blank records with each new 
purchase.  
0
Reply Utf 4/27/2010 4:22:01 AM

Mmanis -

You can step through the code to find the problem, but it could be eaiser to 
make the field a required field in the Items table.  Then wherever in the 
code it is adding a blank record, it will error out - at that point you can 
select the Debug option and then fix the code.

-- 
Daryl S


"mmanis" wrote:

> Hello, I have a form (frmpurchases) based on a query.  My query is based on 
> two tables. tblPurchases (master table) and tblItems (lookup table describing 
> the item category).  The field link between the two tables is the field 
> called Items.
> 
> On frmPurchases, there is a list box for selecting the type of Item. which 
> once selected, autofills various other fields with the Items details.  
> Everything seems to work fine and I have no problem adding records etc.  The 
> one glitch I can't figure out, is everytime I add a new purchase using 
> frmpurchases and select the Item(list box), when I go out of the database and 
> come back in, there is a new blank record in my TblItems for every new 
> purchase I entered. So if I select the list box again, there will be blanks 
> in the list for every new record.
> 
> How can I prevent my lookup table from adding blank records with each new 
> purchase.  
0
Reply Utf 4/27/2010 2:31:02 PM


1 Replies
222 Views

(page loaded in 0.035 seconds)

Similiar Articles:
















7/16/2012 7:14:26 PM


Reply: