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

Recordset update and option group need help

Status
Not open for further replies.

tony9bb

Technical User
Sep 1, 2001
12
US
I'm not a "seasoned" VBA coder but I'm learning through this forum. Now I need to ask a question.

I have a form with a combobox and an option group. I have the following code in the After_Update of Frame81:
********************************
Private Sub Frame81_AfterUpdate()
'This procedure selects the status of the equipment
'All equipment is set to "Not Used" previously, by default
'Only the equipment used is changed

Dim tbl As TableDef
Dim db As Database
Dim rst As Recordset
Dim strEquipment, strStatus As String
Set db = CurrentDb()
Set tbl = db.TableDefs("tblProjects")
Set rst = tbl.OpenRecordset
'Sets the equipment name by what was selected in the combobox
strEquipment = Me.EquipChoice
'Find the Status from the optiongroup
strStatus = Choose(Me.Frame81, "Not Used", "Active", "Inactive")
'Update the record
With rst
.Edit
rst(strEquipment) = strStatus
.Update
End With
***************************************
My idea is that the user selects a choice from a combobox, then selects whether the selected choice is 1)Not Used 2) Active 3)Inactive from the option group.
I then update the record according to the selection in the option group.

The problem is: When I select a second choice in the combobox, I get an information box telling me the data has been edited by another user and that I should re-edit the record.

I thought the ".update" would prevent this from happening.
How can I allow multiple selections in the combobox AND the option group without the message coming up.

thanks
tony
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top