Workingonit
Registered User.
- Local time
- Today, 11:43
- Joined
- Jun 4, 2015
- Messages
- 10
Good day!
I feel like I am very close to solving this but because I'm a little rusty in my vba I cannot seem to figure this one out.
I have a main form "Furniture_CatCodeAssets" which shows detail specifics about certain furniture item codes (width, height, colour etc.). I have a subform "Furniture_AssetsSubform" which shows all of the asset numbers associated with that furniture item code.
I have a combo box that allows you to filter by furniture category, that then updates a list box that shows only the item codes associated with that category. When an item code is selected in the list box the main form and the subform update to show what was selected. (I mention this only in case it is causing an interruption - they work perfectly.)
What I am trying to do now is add a text box and button that will allow you to search in the subform to find a specific asset number and go to that item code on the main form.
I have the following code on the command button:
Set rst = Forms!furniture_CatCodeAsset.Furniture_AssetsSubform.Form.RecordsetClone
rst.FindFirst "[Asset Number]=" & Me.textSearch
If Not rst.NoMatch Then
Forms!furniture_CatCodeAsset!Furniture_AssetsSubform.Form.Bookmark = rst.Bookmark
Else
MsgBox "No match found, please check your asset number and try again."
End If
Me.textSearch = Null
rst.Close
Set rst = Nothing
Which returns the message box that nothing was found even though I know I that asset number exists.
I am really hoping that this makes sense and that someone is able to help me figure out how to code this! Thank you in advance!
I feel like I am very close to solving this but because I'm a little rusty in my vba I cannot seem to figure this one out.
I have a main form "Furniture_CatCodeAssets" which shows detail specifics about certain furniture item codes (width, height, colour etc.). I have a subform "Furniture_AssetsSubform" which shows all of the asset numbers associated with that furniture item code.
I have a combo box that allows you to filter by furniture category, that then updates a list box that shows only the item codes associated with that category. When an item code is selected in the list box the main form and the subform update to show what was selected. (I mention this only in case it is causing an interruption - they work perfectly.)
What I am trying to do now is add a text box and button that will allow you to search in the subform to find a specific asset number and go to that item code on the main form.
I have the following code on the command button:
Set rst = Forms!furniture_CatCodeAsset.Furniture_AssetsSubform.Form.RecordsetClone
rst.FindFirst "[Asset Number]=" & Me.textSearch
If Not rst.NoMatch Then
Forms!furniture_CatCodeAsset!Furniture_AssetsSubform.Form.Bookmark = rst.Bookmark
Else
MsgBox "No match found, please check your asset number and try again."
End If
Me.textSearch = Null
rst.Close
Set rst = Nothing
Which returns the message box that nothing was found even though I know I that asset number exists.
I am really hoping that this makes sense and that someone is able to help me figure out how to code this! Thank you in advance!