I recently converted to a split database due to errors we were encountering with multiple users. The backend resides on the server, and the front end accde file resides on local machines.
The split database master file I used to create the front end does not report any errors with I use Debug>Compile in the VBA
However, there is a key event procedure on one of the forms that does not function when I make the accde version of the database. It is a textbox named txtString. Users use this textbox to search records and populate a drop down based on the text entered, and thus populate the form.
The code for the txtString AfterUpdate is:
Private Sub txtString_AfterUpdate()
Dim strQuery As String
strQuery = "SELECT [Animal Records].[Animal ID], [Animal Records].[House Name], [Animal Records].[Aliases] FROM [Animal Records] WHERE ([Animal Records].[House Name] LIKE '*" & Me!txtString.Value & "*'OR [Animal Records].[Aliases] LIKE '*" & Me!txtString.Value & "*') ORDER BY [Animal Records].[House Name];"
Me!ComboSearchNames.RowSource = strQuery
Me!ComboSearchNames.Visible = True
End Sub
The code for the related Combo SearchNames dropdown OnClick event is:
Private Sub ComboSearchNames_Click()
Me.RecordsetClone.FindFirst "[Animal ID] =" & Me.ComboSearchNames
Me.Bookmark = Me.RecordsetClone.Bookmark
Me.txtString = Null
Form.Refresh
Me.[ComboSearchNames].Requery
End Sub
The Combo SearchNames RowSource is a query defined in the RowSource property (i.e. there is not a separate 'dedicated' query that it calls)
Why would this not work in the compiled version? T
Gratefully, Amanda
Reply via web post | Reply to sender | Reply to group | Start a New Topic | Messages in this topic (1) |
Tidak ada komentar:
Posting Komentar