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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Combobox help!!!!!!!!!!!!!!!! (second try)

Status
Not open for further replies.

tlaksh

Programmer
Feb 25, 2001
98
US
I have a table with two columns in SQL linked to a Access 97 form. One of the column is a Primary Key. This column is a combo box on the form. When the form opens it is in view mode. But when i move between the records in the combo box..it does not change the other column info and assums that i am inserting a duplicate record and cribs and raises a error that primary key check conditions have been voilated.

But when i use the navigation bar to move between records everything is fine. I don't want the navigation bar on the form.

Where am i going wrong...I am a amature with access...Thanks for ur help in advance.
 
Is the combo box bound to the first column in the table. If so it will try and enter whatever you input into the box into the table - hence the error.

You need, I think from what you are saying, to have the box unbound, then use code to change the record that the form displays depending on the combo box entry. Use the On Change event procedure to enter your code. Alex Middleton
 
Hi tlaksh!

It sounds like you want to do a Find function to look at a record. Just build your form to show the data, then add a Find combo box.

To add the Find box, start by making sure the wizard button at the top of the toolbox is turned on, then click on the combobox tool. Drop a combobox at the top of your form. The wizard starts and gives you the option to "find a record on my form". You should be able to follow the wizard after that!

The only thing you need to add is a way to keep the records synchronized with the combobox. Let me know if you want to do that and I will tell you how.

Pamela
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top