Hello.
I am having an issue that is driving me insane today.
I have an access form on which there are 4 Combo Boxes.
The form is in MS access but the data to populate the combos is on SQL Server.
I have a pass through query that links to the server and when the form opens, the following code runs:
Private Function GetLevel1()
Dim q As QueryDef
Me.TxtLevel1.ListRows = 20
Set q = CurrentDb.QueryDefs("pt_qryRequest")
q.SQL = "exec dbo.sp_comboTeamNamesLev1 "
Me.TxtLevel1.Requery
End Function
Private Function GetLevel2()
Dim q As QueryDef
Me.TxtLevel2.ListRows = 20
Set q = CurrentDb.QueryDefs("pt_qryRequest")
q.SQL = "exec dbo.sp_comboTeamNamesLev2 "
Me.TxtLevel2.Requery
End Function
But once the form opens, the same data is listed in both of these combo boxes.
I have looked at another database here and it does the same thing - Codewise for 2 seperate combos but when the form open there is diffreent data in both combos. If it was not for seeing this I would have given up by now and figured it can't be achieved with one pass through query
Am I doing something completely stupid or is there something really clever in the other database.
I can not see where there is a differenece.
I would really appreciate any comments on what I am doing wrong.
Thank you in advance
JP
I am having an issue that is driving me insane today.
I have an access form on which there are 4 Combo Boxes.
The form is in MS access but the data to populate the combos is on SQL Server.
I have a pass through query that links to the server and when the form opens, the following code runs:
Private Function GetLevel1()
Dim q As QueryDef
Me.TxtLevel1.ListRows = 20
Set q = CurrentDb.QueryDefs("pt_qryRequest")
q.SQL = "exec dbo.sp_comboTeamNamesLev1 "
Me.TxtLevel1.Requery
End Function
Private Function GetLevel2()
Dim q As QueryDef
Me.TxtLevel2.ListRows = 20
Set q = CurrentDb.QueryDefs("pt_qryRequest")
q.SQL = "exec dbo.sp_comboTeamNamesLev2 "
Me.TxtLevel2.Requery
End Function
But once the form opens, the same data is listed in both of these combo boxes.
I have looked at another database here and it does the same thing - Codewise for 2 seperate combos but when the form open there is diffreent data in both combos. If it was not for seeing this I would have given up by now and figured it can't be achieved with one pass through query
Am I doing something completely stupid or is there something really clever in the other database.
I can not see where there is a differenece.
I would really appreciate any comments on what I am doing wrong.
Thank you in advance
JP