A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Using list box adds blank record to lookup table



 
 
Thread Tools Display Modes
  #1  
Old April 27th, 2010, 05:22 AM posted to microsoft.public.access.forms
mmanis
external usenet poster
 
Posts: 7
Default Using list box adds blank record to lookup table

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.
  #2  
Old April 27th, 2010, 03:31 PM posted to microsoft.public.access.forms
Daryl S[_2_]
external usenet poster
 
Posts: 881
Default Using list box adds blank record to lookup table

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.

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 02:46 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.