0
votes

I'm hoping someone can help here. I have a continuous form in Access 2013, I have code in already which allows you to search for a specific item, this is on click event for a button, I also have a reset which again is on click event for another button. Through using a query in a row source of a combo box I have managed to create a combo that limits what can be selected by a field in the form. (Thanks to Matt Hill) There is also a current event as a combobox requery running too.

I have also managed to put a textbox over the combo boxes to hide them, however I can't get the text boxes to show what the combo boxes have and then keep that data when I move onto the next combo box and select another item, what is currently happening is that the combo boxes keep changing and all display the same object when chosen and when I move to the next combo box it clears the data in all combo boxes and show the new selection instead.

This is driving me mad so any help what so ever would be greatly appreciated.

Hi All update, please see the VBA below for what is running:

Private Sub Command26_Click()
Dim strsearch As String
Dim Task As String
'Check if a keyword entered or not
If IsNull(Me.txtsearch) Or Me.txtsearch = "" Then
   MsgBox "Please type in your search keyword.", vbOKOnly, "Keyword Needed"
   Me.txtsearch.BackColor = vbYellow
   Me.txtsearch.SetFocus
Else
    strsearch = Me.txtsearch.Value
    Task = "SELECT * FROM Base_Data WHERE ((PARENT_FSC Like ""*" & strsearch & "*""))"
   Me.RecordSource = Task
   Me.txtsearch.BackColor = vbWhite
End If
End Sub

Private Sub Command27_Click()
Dim strsearch As String
strsearch = "SELECT * from Base_Data"
Me.RecordSource = strsearch
End Sub

Private Sub Form_Current()

    Me.cboComponent.Requery

End Sub

As well as this code running I also have an SQL query in the record source of the Form Properties.

Again any help would be great.

1
You'll have to provide us with a little more information in order to help you. Are the combo boxes linked somehow (by name, by group, other means)? Is there any VBA code on the form that is automatically changing anything upon entry into any of your control boxes? If there is any VBA code thus far, please include it into your question.Ralph
A screenshot would help too. It sounds a bit as if you have an unbound combobox in the Detail section of a continuous form - this will always show the same data in all rows.Andre
Hi both, thanks for replying. Sorry for the late response I've had to go on another tangent task which has taken priority. Looking back at this I'll try and get some screen shots of the query and code.Justin Baker
@Ralph please see the attached, sorry for the time difference. got back to this and would appreciate any help. CheersJustin Baker
@Andre Hi, just putting more detail up, sorry for the long delay on this. Any help would be great. CheersJustin Baker

1 Answers

0
votes

Unbound Controls, on a continuous form, act as one Control - because they have no Control Source. i.e. The Record/Field in the target Table, for which they are bound.