A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Please help in this dynamic query



 
 
Thread Tools Display Modes
  #1  
Old November 28th, 2005, 09:07 PM posted to microsoft.public.access.reports
external usenet poster
 
Posts: n/a
Default 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  
Old November 29th, 2005, 03:49 AM posted to microsoft.public.access.reports
external usenet poster
 
Posts: n/a
Default 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  
Old November 29th, 2005, 06:44 AM posted to microsoft.public.access.reports
external usenet poster
 
Posts: n/a
Default 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  
Old November 29th, 2005, 07:05 AM posted to microsoft.public.access.reports
external usenet poster
 
Posts: n/a
Default 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  
Old November 29th, 2005, 08:39 AM posted to microsoft.public.access.reports
external usenet poster
 
Posts: n/a
Default 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  
Old November 30th, 2005, 03:43 AM posted to microsoft.public.access.reports
external usenet poster
 
Posts: n/a
Default 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  
Old November 30th, 2005, 05:34 AM posted to microsoft.public.access.reports
external usenet poster
 
Posts: n/a
Default 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  
Old November 30th, 2005, 07:38 AM posted to microsoft.public.access.reports
external usenet poster
 
Posts: n/a
Default 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  
Old November 30th, 2005, 05:08 PM posted to microsoft.public.access.reports
external usenet poster
 
Posts: n/a
Default 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  
Old December 1st, 2005, 06:59 AM posted to microsoft.public.access.reports
external usenet poster
 
Posts: n/a
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

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


All times are GMT +1. The time now is 04:04 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.