If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Please help in this dynamic query
This is the code i have in report open event.....
what is the problem...i get "enter parameter " message when run the report Dim asDB As Database Dim r1s As Recordset Dim strSQL As String Dim d8, d9 As Variant Set asDB = CurrentDb 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) Set r1s = asDB.OpenRecordset(strSQL) Me.RecordSource = strSQL r1s.MoveFirst With r1s Do While Not .EOF Me.Text12.ControlSource = r1s("totals") r1s.MoveNext Loop End With kindly help me ....i spent days ..no use .....thanks |
#2
|
|||
|
|||
Please help in this dynamic query
Try place a breakpoint prior to or on this line
Set r1s = asDB.OpenRecordset(strSQL) When the code breaks, open the debug window (press Ctrl+G) and enter ? strSQL Copy the value of strSQL and paste it into a new blank query. Let us know what happens. -- Duane Hookom MS Access MVP "ismail" wrote in message ... This is the code i have in report open event..... what is the problem...i get "enter parameter " message when run the report Dim asDB As Database Dim r1s As Recordset Dim strSQL As String Dim d8, d9 As Variant Set asDB = CurrentDb 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) Set r1s = asDB.OpenRecordset(strSQL) Me.RecordSource = strSQL r1s.MoveFirst With r1s Do While Not .EOF Me.Text12.ControlSource = r1s("totals") r1s.MoveNext Loop End With kindly help me ....i spent days ..no use .....thanks |
#3
|
|||
|
|||
Please help in this dynamic query
yes i did as you told......
SELECT Store,dateofS,totalS ,stid FROM details where stid=1 this is the value and if i run this in new blank query..i get the result... please reply...Thanks "Duane Hookom" wrote: Try place a breakpoint prior to or on this line Set r1s = asDB.OpenRecordset(strSQL) When the code breaks, open the debug window (press Ctrl+G) and enter ? strSQL Copy the value of strSQL and paste it into a new blank query. Let us know what happens. -- Duane Hookom MS Access MVP "ismail" wrote in message ... This is the code i have in report open event..... what is the problem...i get "enter parameter " message when run the report Dim asDB As Database Dim r1s As Recordset Dim strSQL As String Dim d8, d9 As Variant Set asDB = CurrentDb 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) Set r1s = asDB.OpenRecordset(strSQL) Me.RecordSource = strSQL r1s.MoveFirst With r1s Do While Not .EOF Me.Text12.ControlSource = r1s("totals") r1s.MoveNext Loop End With kindly help me ....i spent days ..no use .....thanks |
#4
|
|||
|
|||
Please help in this dynamic query
There is probably a control or sorting level bound to a field that isn't in
the record source. If you can't figure this out, consider providing information on why you are opening a recordset in a report. -- Duane Hookom MS Access MVP "ismail" wrote in message ... yes i did as you told...... SELECT Store,dateofS,totalS ,stid FROM details where stid=1 this is the value and if i run this in new blank query..i get the result... please reply...Thanks "Duane Hookom" wrote: Try place a breakpoint prior to or on this line Set r1s = asDB.OpenRecordset(strSQL) When the code breaks, open the debug window (press Ctrl+G) and enter ? strSQL Copy the value of strSQL and paste it into a new blank query. Let us know what happens. -- Duane Hookom MS Access MVP "ismail" wrote in message ... This is the code i have in report open event..... what is the problem...i get "enter parameter " message when run the report Dim asDB As Database Dim r1s As Recordset Dim strSQL As String Dim d8, d9 As Variant Set asDB = CurrentDb 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) Set r1s = asDB.OpenRecordset(strSQL) Me.RecordSource = strSQL r1s.MoveFirst With r1s Do While Not .EOF Me.Text12.ControlSource = r1s("totals") r1s.MoveNext Loop End With kindly help me ....i spent days ..no use .....thanks |
#5
|
|||
|
|||
Please help in this dynamic query
I see there is no bound control or sorting on this field...
please give me instruction what to do...? i just want to show the output in the report...i am doing this first time...(calling report and assigning recordsource through vba...)...please change my code according the right way..to do this.. Thanks "Duane Hookom" wrote: There is probably a control or sorting level bound to a field that isn't in the record source. If you can't figure this out, consider providing information on why you are opening a recordset in a report. -- Duane Hookom MS Access MVP "ismail" wrote in message ... yes i did as you told...... SELECT Store,dateofS,totalS ,stid FROM details where stid=1 this is the value and if i run this in new blank query..i get the result... please reply...Thanks "Duane Hookom" wrote: Try place a breakpoint prior to or on this line Set r1s = asDB.OpenRecordset(strSQL) When the code breaks, open the debug window (press Ctrl+G) and enter ? strSQL Copy the value of strSQL and paste it into a new blank query. Let us know what happens. -- Duane Hookom MS Access MVP "ismail" wrote in message ... This is the code i have in report open event..... what is the problem...i get "enter parameter " message when run the report Dim asDB As Database Dim r1s As Recordset Dim strSQL As String Dim d8, d9 As Variant Set asDB = CurrentDb 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) Set r1s = asDB.OpenRecordset(strSQL) Me.RecordSource = strSQL r1s.MoveFirst With r1s Do While Not .EOF Me.Text12.ControlSource = r1s("totals") r1s.MoveNext Loop End With kindly help me ....i spent days ..no use .....thanks |
#6
|
|||
|
|||
Please help in this dynamic query
You have never told us what the parameter prompt message is.
You can set the Record Source property of a report on the Open event of the report. You shouldn't need to create a recordset. -- Duane Hookom MS Access MVP "ismail" wrote in message ... I see there is no bound control or sorting on this field... please give me instruction what to do...? i just want to show the output in the report...i am doing this first time...(calling report and assigning recordsource through vba...)...please change my code according the right way..to do this.. Thanks "Duane Hookom" wrote: There is probably a control or sorting level bound to a field that isn't in the record source. If you can't figure this out, consider providing information on why you are opening a recordset in a report. -- Duane Hookom MS Access MVP "ismail" wrote in message ... yes i did as you told...... SELECT Store,dateofS,totalS ,stid FROM details where stid=1 this is the value and if i run this in new blank query..i get the result... please reply...Thanks "Duane Hookom" wrote: Try place a breakpoint prior to or on this line Set r1s = asDB.OpenRecordset(strSQL) When the code breaks, open the debug window (press Ctrl+G) and enter ? strSQL Copy the value of strSQL and paste it into a new blank query. Let us know what happens. -- Duane Hookom MS Access MVP "ismail" wrote in message ... This is the code i have in report open event..... what is the problem...i get "enter parameter " message when run the report Dim asDB As Database Dim r1s As Recordset Dim strSQL As String Dim d8, d9 As Variant Set asDB = CurrentDb 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) Set r1s = asDB.OpenRecordset(strSQL) Me.RecordSource = strSQL r1s.MoveFirst With r1s Do While Not .EOF Me.Text12.ControlSource = r1s("totals") r1s.MoveNext Loop End With kindly help me ....i spent days ..no use .....thanks |
#7
|
|||
|
|||
Please help in this dynamic query
The message box is
"Enter Parameter value" ----Title 2232.45 - value of the field which i want to display in the report - Empty text box ok cancel and what is right way or syntax to assign recordsource to report in open event of report..i create recordset in form and how can i pass to report..or how can i assign to report..please kindly help me Thanks "Duane Hookom" wrote: You have never told us what the parameter prompt message is. You can set the Record Source property of a report on the Open event of the report. You shouldn't need to create a recordset. -- Duane Hookom MS Access MVP "ismail" wrote in message ... I see there is no bound control or sorting on this field... please give me instruction what to do...? i just want to show the output in the report...i am doing this first time...(calling report and assigning recordsource through vba...)...please change my code according the right way..to do this.. Thanks "Duane Hookom" wrote: There is probably a control or sorting level bound to a field that isn't in the record source. If you can't figure this out, consider providing information on why you are opening a recordset in a report. -- Duane Hookom MS Access MVP "ismail" wrote in message ... yes i did as you told...... SELECT Store,dateofS,totalS ,stid FROM details where stid=1 this is the value and if i run this in new blank query..i get the result... please reply...Thanks "Duane Hookom" wrote: Try place a breakpoint prior to or on this line Set r1s = asDB.OpenRecordset(strSQL) When the code breaks, open the debug window (press Ctrl+G) and enter ? strSQL Copy the value of strSQL and paste it into a new blank query. Let us know what happens. -- Duane Hookom MS Access MVP "ismail" wrote in message ... This is the code i have in report open event..... what is the problem...i get "enter parameter " message when run the report Dim asDB As Database Dim r1s As Recordset Dim strSQL As String Dim d8, d9 As Variant Set asDB = CurrentDb 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) Set r1s = asDB.OpenRecordset(strSQL) Me.RecordSource = strSQL r1s.MoveFirst With r1s Do While Not .EOF Me.Text12.ControlSource = r1s("totals") r1s.MoveNext Loop End With kindly help me ....i spent days ..no use .....thanks |
#8
|
|||
|
|||
Please help in this dynamic query
I think it is not possible ? is it?
"ismail" wrote: The message box is "Enter Parameter value" ----Title 2232.45 - value of the field which i want to display in the report - Empty text box ok cancel and what is right way or syntax to assign recordsource to report in open event of report..i create recordset in form and how can i pass to report..or how can i assign to report..please kindly help me Thanks "Duane Hookom" wrote: You have never told us what the parameter prompt message is. You can set the Record Source property of a report on the Open event of the report. You shouldn't need to create a recordset. -- Duane Hookom MS Access MVP "ismail" wrote in message ... I see there is no bound control or sorting on this field... please give me instruction what to do...? i just want to show the output in the report...i am doing this first time...(calling report and assigning recordsource through vba...)...please change my code according the right way..to do this.. Thanks "Duane Hookom" wrote: There is probably a control or sorting level bound to a field that isn't in the record source. If you can't figure this out, consider providing information on why you are opening a recordset in a report. -- Duane Hookom MS Access MVP "ismail" wrote in message ... yes i did as you told...... SELECT Store,dateofS,totalS ,stid FROM details where stid=1 this is the value and if i run this in new blank query..i get the result... please reply...Thanks "Duane Hookom" wrote: Try place a breakpoint prior to or on this line Set r1s = asDB.OpenRecordset(strSQL) When the code breaks, open the debug window (press Ctrl+G) and enter ? strSQL Copy the value of strSQL and paste it into a new blank query. Let us know what happens. -- Duane Hookom MS Access MVP "ismail" wrote in message ... This is the code i have in report open event..... what is the problem...i get "enter parameter " message when run the report Dim asDB As Database Dim r1s As Recordset Dim strSQL As String Dim d8, d9 As Variant Set asDB = CurrentDb 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) Set r1s = asDB.OpenRecordset(strSQL) Me.RecordSource = strSQL r1s.MoveFirst With r1s Do While Not .EOF Me.Text12.ControlSource = r1s("totals") r1s.MoveNext Loop End With kindly help me ....i spent days ..no use .....thanks |
#9
|
|||
|
|||
Please help in this dynamic query
Do you have a field named "2232.45"? I doubt this is possible since the
period is not allowed in field/column names. -- Duane Hookom MS Access MVP -- "ismail" wrote in message ... I think it is not possible ? is it? "ismail" wrote: The message box is "Enter Parameter value" ----Title 2232.45 - value of the field which i want to display in the report - Empty text box ok cancel and what is right way or syntax to assign recordsource to report in open event of report..i create recordset in form and how can i pass to report..or how can i assign to report..please kindly help me Thanks "Duane Hookom" wrote: You have never told us what the parameter prompt message is. You can set the Record Source property of a report on the Open event of the report. You shouldn't need to create a recordset. -- Duane Hookom MS Access MVP "ismail" wrote in message ... I see there is no bound control or sorting on this field... please give me instruction what to do...? i just want to show the output in the report...i am doing this first time...(calling report and assigning recordsource through vba...)...please change my code according the right way..to do this.. Thanks "Duane Hookom" wrote: There is probably a control or sorting level bound to a field that isn't in the record source. If you can't figure this out, consider providing information on why you are opening a recordset in a report. -- Duane Hookom MS Access MVP "ismail" wrote in message ... yes i did as you told...... SELECT Store,dateofS,totalS ,stid FROM details where stid=1 this is the value and if i run this in new blank query..i get the result... please reply...Thanks "Duane Hookom" wrote: Try place a breakpoint prior to or on this line Set r1s = asDB.OpenRecordset(strSQL) When the code breaks, open the debug window (press Ctrl+G) and enter ? strSQL Copy the value of strSQL and paste it into a new blank query. Let us know what happens. -- Duane Hookom MS Access MVP "ismail" wrote in message ... This is the code i have in report open event..... what is the problem...i get "enter parameter " message when run the report Dim asDB As Database Dim r1s As Recordset Dim strSQL As String Dim d8, d9 As Variant Set asDB = CurrentDb 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) Set r1s = asDB.OpenRecordset(strSQL) Me.RecordSource = strSQL r1s.MoveFirst With r1s Do While Not .EOF Me.Text12.ControlSource = r1s("totals") r1s.MoveNext Loop End With kindly help me ....i spent days ..no use .....thanks |
#10
|
|||
|
|||
Please help in this dynamic query
i found that ...this number is one of the values in the table...
"Duane Hookom" wrote: Do you have a field named "2232.45"? I doubt this is possible since the period is not allowed in field/column names. -- Duane Hookom MS Access MVP -- "ismail" wrote in message ... I think it is not possible ? is it? "ismail" wrote: The message box is "Enter Parameter value" ----Title 2232.45 - value of the field which i want to display in the report - Empty text box ok cancel and what is right way or syntax to assign recordsource to report in open event of report..i create recordset in form and how can i pass to report..or how can i assign to report..please kindly help me Thanks "Duane Hookom" wrote: You have never told us what the parameter prompt message is. You can set the Record Source property of a report on the Open event of the report. You shouldn't need to create a recordset. -- Duane Hookom MS Access MVP "ismail" wrote in message ... I see there is no bound control or sorting on this field... please give me instruction what to do...? i just want to show the output in the report...i am doing this first time...(calling report and assigning recordsource through vba...)...please change my code according the right way..to do this.. Thanks "Duane Hookom" wrote: There is probably a control or sorting level bound to a field that isn't in the record source. If you can't figure this out, consider providing information on why you are opening a recordset in a report. -- Duane Hookom MS Access MVP "ismail" wrote in message ... yes i did as you told...... SELECT Store,dateofS,totalS ,stid FROM details where stid=1 this is the value and if i run this in new blank query..i get the result... please reply...Thanks "Duane Hookom" wrote: Try place a breakpoint prior to or on this line Set r1s = asDB.OpenRecordset(strSQL) When the code breaks, open the debug window (press Ctrl+G) and enter ? strSQL Copy the value of strSQL and paste it into a new blank query. Let us know what happens. -- Duane Hookom MS Access MVP "ismail" wrote in message ... This is the code i have in report open event..... what is the problem...i get "enter parameter " message when run the report Dim asDB As Database Dim r1s As Recordset Dim strSQL As String Dim d8, d9 As Variant Set asDB = CurrentDb 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) Set r1s = asDB.OpenRecordset(strSQL) Me.RecordSource = strSQL r1s.MoveFirst With r1s Do While Not .EOF Me.Text12.ControlSource = r1s("totals") r1s.MoveNext Loop End With kindly help me ....i spent days ..no use .....thanks |
|
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
AHHHH-Get Data from Multiple Excel workbooks | JAA149 | General Discussion | 5 | October 30th, 2005 05:19 PM |
Crosstab Query Help | Becks | New Users | 17 | October 11th, 2005 08:31 PM |
Nested in-line Query | laura | Running & Setting Up Queries | 0 | February 11th, 2005 12:17 AM |
Big number gives error! | Sara Mellen | Running & Setting Up Queries | 8 | October 11th, 2004 02:48 AM |
Newbie? Do I use Report or Query | John Egan | New Users | 11 | June 28th, 2004 08:31 PM |