I
ismail
Please help me in this issue....here is my code..and tabel struct.
column name datatype
dateofS date
stid number
stname text
petrol number
dessel number
store number
oils number
totalS number
in the form i have 3 combo box list
in first combo i have values like petrol,dessel,store,oils (user may select
any one of this)
in second i have stid (user may select 1 or 2 or 3......etc)
in third i will select the date value (01/09/2005 or 02/06/2005......)
my query as follows...
Dim strSQL As String
Dim d8, d9 As Variant
d8 = Forms!searchfrm!activitycmb
strSQL = "SELECT " & d8 & ",dateofS,totalS ,stid FROM details where stid=" &
Forms!searchfrm!stidcmb & ""
strSQL = Replace(strSQL, " & Forms!searchfrm!stidcmb & ",
Forms!searchfrm!activitycmb)
activitycmb will give petrol or dissel or oil etc....
forms!searchfrm!stidcmb will give stid
Set r1s = asDB.OpenRecordset(strSQL)
Me.RecordSource = strSQL
r1s.MoveFirst
Do While r1s.EOF = False
Me.Text8.ControlSource = Forms!searchfrm!activitycmb
r1s.MoveNext
Loop
it is working fine i am able to display the values petrol or dissel etc..in
my report
my Question is how can display other values in the query like dateofS,totalS
,stid.
please help me i am very much confussed..
Thanks in advance
column name datatype
dateofS date
stid number
stname text
petrol number
dessel number
store number
oils number
totalS number
in the form i have 3 combo box list
in first combo i have values like petrol,dessel,store,oils (user may select
any one of this)
in second i have stid (user may select 1 or 2 or 3......etc)
in third i will select the date value (01/09/2005 or 02/06/2005......)
my query as follows...
Dim strSQL As String
Dim d8, d9 As Variant
d8 = Forms!searchfrm!activitycmb
strSQL = "SELECT " & d8 & ",dateofS,totalS ,stid FROM details where stid=" &
Forms!searchfrm!stidcmb & ""
strSQL = Replace(strSQL, " & Forms!searchfrm!stidcmb & ",
Forms!searchfrm!activitycmb)
activitycmb will give petrol or dissel or oil etc....
forms!searchfrm!stidcmb will give stid
Set r1s = asDB.OpenRecordset(strSQL)
Me.RecordSource = strSQL
r1s.MoveFirst
Do While r1s.EOF = False
Me.Text8.ControlSource = Forms!searchfrm!activitycmb
r1s.MoveNext
Loop
it is working fine i am able to display the values petrol or dissel etc..in
my report
my Question is how can display other values in the query like dateofS,totalS
,stid.
please help me i am very much confussed..
Thanks in advance