Add record to DB after look up

A

abprules

I am having trouble with this scenario. Can someone please help? It
seems to be basic but I can't quite figure the code completely out!

Here's the scenario.

I have a form called frmSearchNWCInd. On that form, I have a combo box
for a to look up contacts in the DB.

If the contact is found, I want to be transferred to a form called
frmNWCont_Ind_Tabs with the persons record selected.

If the contact is not found, I want to add that contact as a new record
and once it is added, then transfer to the form called
frmNWCont_Ind_Tabs, and I want the frmSearchNWCInd to close.


(Currently, I have a button that allows one to add a new record
(butAddNewRec) but when typing in a name in the search (combo) box, and
it is not found, and then clicking on the Add Record button, the
following error pops up:
"The text you entered is not an item in the list. Select an item from
the list, or enter text that matches one of the listed item." )

Can anyone tell me the code to accomplish this?
 
D

Dennis

I am having trouble with this scenario. Can someone please help? It
seems to be basic but I can't quite figure the code completely out!

Here's the scenario.

I have a form called frmSearchNWCInd. On that form, I have a combo box
for a to look up contacts in the DB.

If the contact is found, I want to be transferred to a form called
frmNWCont_Ind_Tabs with the persons record selected.

If the contact is not found, I want to add that contact as a new record
and once it is added, then transfer to the form called
frmNWCont_Ind_Tabs, and I want the frmSearchNWCInd to close.


(Currently, I have a button that allows one to add a new record
(butAddNewRec) but when typing in a name in the search (combo) box, and
it is not found, and then clicking on the Add Record button, the
following error pops up:
"The text you entered is not an item in the list. Select an item from
the list, or enter text that matches one of the listed item." )

Can anyone tell me the code to accomplish this?
 
A

abprules

Ok, Dennis. I did that. however, I then had to go change my column
lengths (the first was set to 0 because I have an expression to show
the Lname, first name, middle name in the box). After I changed the
length and kept my bound column at 1, that no longer gave me the error
message.
However, when I clicked on the Add Record button, it did nothing?? It
didn't add the person to the contacts table?

Any help is appreciated.
 
Top