adding records to connected-table only in case there is no such record already

Draekus

New member
Local time
Tomorrow, 00:37
Joined
Mar 19, 2007
Messages
2
Hi! At first I'm sorry if there is already such a thread but I couldn't find none.

I have a Base that i use to record parts bought for tractors. Since I have to store some info about each part (and later track the best offerers) I created a table:

tblParts

in which I want to store ID NAME and CATEGORYID of different parts I also have a table that stores transactions (purchases)

tblPurchases

Both of those are connected throo the field ID from tblParts.
I've made a form that adds records to tblPurchases, it uses a combo box to pick the bought part from tblParts, but since we use few hunderts of different parts its pretty annoing to pick them up, or search them from tle combo box. But most annoing will be adding every new part to the tblParts using another miniform, since there area lot of new parts in every invoice.

Is there any way to do so:

I type the part I've just bought to tblPurchase in the combo box, there is no such part in tblParts yet so when I add the record the form autoamaticly ads a new part to tblWares. It is not a problem to set the category later, or set some "none" temporally.

??
I've just started to play around with VBA so I don't realy know where to start, but a hint should kick me in the right directoin.

Thanks in advance!!
 
You might want to set the Limit to List property of your partID combobox to Yes.
Then on Not in list event fire the new form which takes in user input from a parts form opened in add mode.
I'm sorry if I misunderstood anything. But the way I see it is you have a partID combobox and you want to be able to add new entries on the fly?
HTH
Suds.
 
Many thanks! Didn't thought it's that simple... could you just tell me how to do the following?

...Then on Not in list event fire the new form which takes in user input from a parts form opened in add mode....

I not how to fire the, lets say miniform to add new parts, but how to open it with NAME filled already with the text I used in Purchase Form ?
 

Users who are viewing this thread

Back
Top Bottom