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

How to relate optionGroup box with combo box ?

Status
Not open for further replies.

hu5

Technical User
Apr 9, 2004
28
US
I set up a optionGroup box called Type which has 5 different type, and a combo box called FindRecord which shows 2 fields consists of SRM NO & Type.
When user select a SRM NO(Text) to find an existing record, the type optionGroup should reflect the type automatically correspond to the one in combo Box, the code below doesn't work, no matter where I placed this statement: Me!Type = Me!FindRecord.Column(1), it keeps prompting me to save record, even I save it, it still not working.
If I add a new record, the type I select in optionGroup doesn't get loaded into the type column in the table either.
Any help would be greatly appreciated.

Private Sub FindRecord_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[SRM No] = '" & Me![FindRecord] & "'"
Me.Bookmark = rs.Bookmark
Me!Type = Me!FindRecord.Column(1)

End Sub
 
hu5

Is Me.Type the name of the Option Group or an option that is part of the Option Group?

Next, the Option Group stores a numeric value. The option buttons do not.

Me.YourOptionGroup = 1

Would set the value to 1

Which leads to the next possible problem...
Is Me![FindRecord] numeric and going to have a corresponding number on the option group?

Richard
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top