Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

create a form that will update an existing table or add a new record

Status
Not open for further replies.

gray78

Programmer
Feb 3, 2005
78
US
I am having trouble creating a form that will be able to update an existing table as well as add new records. The form has a combo box(tag#), but if I want to add a new tag#, I cannot do this. The combo box allows me to see existing tag#'s and the data associated to them.

Any suggestions?

Thanks
 
Given:
The control has access to the entire column of data in the table.

Then:
Test the [controlname].ListIndex when you are ready to add the item. If [controlname].ListIndex = -1 then the entry is not in the controls list(which should represent the entire list of entries in the underlying table). If that's the case then add the item to the table then requery the control.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top