Hi all,
I have the below code. I try to check a textbox to see which are the first 3 characters to run query1 or query2.
I don't seem to get it work and I don't know why. There are 2 branches that start with 3 first numbers (12388765) and the rest of the numbers is the store number.
Any chance I do something wrong?
Code:
Option Compare Database
Option Explicit
Sub Check_first_branch_nr_Click()
If Me.branch_txt Like "988*" Then
query_results1
Else
query_results2
End If
End Sub
Private Sub query_results1()
Dim stDocName As String
stDocName = "Query1"
DoCmd.OpenQuery stDocName, acNormal, acEdit
End Sub
Private Sub query_results2()
Dim stDocName As String
stDocName = "Query2 UBN"
DoCmd.OpenQuery stDocName, acNormal, acEdit
End Sub
Greetings.