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

Read value from Combo Box

Status
Not open for further replies.

ksbigfoot

Programmer
Apr 15, 2002
856
CA
I am stumped trying to get this to work.
I am inserting a new record into a subform, but before the record gets inserted, I want to check to see if the record already exists but isn't being displayed (because of a display flag set to false). If the record has a display flag = false, I want to cancel the insert, set the flag to true and refresh the datasheet.
My problem is that when I pick a value from the combo box and the Form_BeforeInsert event gets called, I am trying to read the value from the combo box, but I can't seem to find the correct code to read the combo box. I am not even sure if BeforeInsert is the right event.
I thought I was able to use the Me.cboPipeID to retrieve the value.
Can someone point me in the right direction?
Thanks
 
I didn't understand how the Before_Insert event worked. The Before_Insert event gets executed as soon as a key is pressed, that is why I couldn't read the combo box. I moved my code to the Before_Update event and it is working.
Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top