Query/Report/Form issue

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

I have a query and a report based on it, which as standalones work
perfectley. Once I add a command button [using the wizard] to a form they
both then return no data. The parameter being passed from the form is a date.
I have checked every form and button property, they are exactly the same as
the other 40 odd queries/reports in my app. I have deleted the form, query
and reports, rebuilt them etc. I have exported the entire db to a new one and
excluded thse quries/reports/forms but all to no avail.

Can anyone give me some pointers as to where else I should look ?

Thanks
 
Can you post the openreport command you wrote?
That will help us to find a problem, if there is one.
 
Hello,

Here is the open query and print preview code.

Cheers

Kevin PD

Private Sub cmd_Open_MG01E_Query_Button_Click()
On Error GoTo Err_cmd_Open_MG01E_Query_Button_Click

Dim stDocName As String

stDocName = "qry_205_654f_MG01E_Daily_Sales_Orders"
DoCmd.OpenQuery stDocName, acNormal, acEdit

Exit_cmd_Open_MG01E_Query_Button_Click:
Exit Sub

Err_cmd_Open_MG01E_Query_Button_Click:
MsgBox Err.description
Resume Exit_cmd_Open_MG01E_Query_Button_Click

End Sub

Private Sub cmd_Open_MG01E_Report_Button_Click()
On Error GoTo Err_cmd_Open_MG01E_Report_Button_Click

Dim stDocName As String

stDocName = "rpt_205_654f_MG01E_Daily_Sales_Orders"
DoCmd.OpenReport stDocName, acPreview

Exit_cmd_Open_MG01E_Report_Button_Click:
Exit Sub

Err_cmd_Open_MG01E_Report_Button_Click:
MsgBox Err.description
Resume Exit_cmd_Open_MG01E_Report_Button_Click

End Sub

Ofer said:
Can you post the openreport command you wrote?
That will help us to find a problem, if there is one.



Kevin PD said:
Hello,

I have a query and a report based on it, which as standalones work
perfectley. Once I add a command button [using the wizard] to a form they
both then return no data. The parameter being passed from the form is a date.
I have checked every form and button property, they are exactly the same as
the other 40 odd queries/reports in my app. I have deleted the form, query
and reports, rebuilt them etc. I have exported the entire db to a new one and
excluded thse quries/reports/forms but all to no avail.

Can anyone give me some pointers as to where else I should look ?

Thanks
 
I understand that the query has a filter with reference to the form.
Select * from MyTable Were DateField = Forms![FormName]![DateFieldName]

Can you post the SQL of qry_205_654f_MG01E_Daily_Sales_Orders, I undertand
that the report is based on it.

Kevin PD said:
Hello,

Here is the open query and print preview code.

Cheers

Kevin PD

Private Sub cmd_Open_MG01E_Query_Button_Click()
On Error GoTo Err_cmd_Open_MG01E_Query_Button_Click

Dim stDocName As String

stDocName = "qry_205_654f_MG01E_Daily_Sales_Orders"
DoCmd.OpenQuery stDocName, acNormal, acEdit

Exit_cmd_Open_MG01E_Query_Button_Click:
Exit Sub

Err_cmd_Open_MG01E_Query_Button_Click:
MsgBox Err.description
Resume Exit_cmd_Open_MG01E_Query_Button_Click

End Sub

Private Sub cmd_Open_MG01E_Report_Button_Click()
On Error GoTo Err_cmd_Open_MG01E_Report_Button_Click

Dim stDocName As String

stDocName = "rpt_205_654f_MG01E_Daily_Sales_Orders"
DoCmd.OpenReport stDocName, acPreview

Exit_cmd_Open_MG01E_Report_Button_Click:
Exit Sub

Err_cmd_Open_MG01E_Report_Button_Click:
MsgBox Err.description
Resume Exit_cmd_Open_MG01E_Report_Button_Click

End Sub

Ofer said:
Can you post the openreport command you wrote?
That will help us to find a problem, if there is one.



Kevin PD said:
Hello,

I have a query and a report based on it, which as standalones work
perfectley. Once I add a command button [using the wizard] to a form they
both then return no data. The parameter being passed from the form is a date.
I have checked every form and button property, they are exactly the same as
the other 40 odd queries/reports in my app. I have deleted the form, query
and reports, rebuilt them etc. I have exported the entire db to a new one and
excluded thse quries/reports/forms but all to no avail.

Can anyone give me some pointers as to where else I should look ?

Thanks
 
Hello,

Hear is the sql, it is just a simple extract from a view in the database.

SELECT informix_v654_vso01_v1_19.reporting_division,
informix_v654_vso01_v1_19.material_division,
informix_v654_vso01_v1_19.branch, informix_v654_vso01_v1_19.order_item,
informix_v654_vso01_v1_19.weight, informix_v654_vso01_v1_19.sales_value,
informix_v654_vso01_v1_19.net_profit, informix_v654_vso01_v1_19.rep_date
FROM informix_v654_vso01_v1_19
WHERE
(((informix_v654_vso01_v1_19.rep_date)=[Forms]![68frmMG01EPrintForm]![ActiveXCtlMin]))
ORDER BY informix_v654_vso01_v1_19.reporting_division,
informix_v654_vso01_v1_19.material_division, informix_v654_vso01_v1_19.branch;


Ofer said:
I understand that the query has a filter with reference to the form.
Select * from MyTable Were DateField = Forms![FormName]![DateFieldName]

Can you post the SQL of qry_205_654f_MG01E_Daily_Sales_Orders, I undertand
that the report is based on it.

Kevin PD said:
Hello,

Here is the open query and print preview code.

Cheers

Kevin PD

Private Sub cmd_Open_MG01E_Query_Button_Click()
On Error GoTo Err_cmd_Open_MG01E_Query_Button_Click

Dim stDocName As String

stDocName = "qry_205_654f_MG01E_Daily_Sales_Orders"
DoCmd.OpenQuery stDocName, acNormal, acEdit

Exit_cmd_Open_MG01E_Query_Button_Click:
Exit Sub

Err_cmd_Open_MG01E_Query_Button_Click:
MsgBox Err.description
Resume Exit_cmd_Open_MG01E_Query_Button_Click

End Sub

Private Sub cmd_Open_MG01E_Report_Button_Click()
On Error GoTo Err_cmd_Open_MG01E_Report_Button_Click

Dim stDocName As String

stDocName = "rpt_205_654f_MG01E_Daily_Sales_Orders"
DoCmd.OpenReport stDocName, acPreview

Exit_cmd_Open_MG01E_Report_Button_Click:
Exit Sub

Err_cmd_Open_MG01E_Report_Button_Click:
MsgBox Err.description
Resume Exit_cmd_Open_MG01E_Report_Button_Click

End Sub

Ofer said:
Can you post the openreport command you wrote?
That will help us to find a problem, if there is one.



:

Hello,

I have a query and a report based on it, which as standalones work
perfectley. Once I add a command button [using the wizard] to a form they
both then return no data. The parameter being passed from the form is a date.
I have checked every form and button property, they are exactly the same as
the other 40 odd queries/reports in my app. I have deleted the form, query
and reports, rebuilt them etc. I have exported the entire db to a new one and
excluded thse quries/reports/forms but all to no avail.

Can anyone give me some pointers as to where else I should look ?

Thanks
 
Is the ActiveXCtlMin is the name of the field that return a date?

Run the Immidiate windows (Press Ctrl+G) type
?[Forms]![68frmMG01EPrintForm]![ActiveXCtlMin]
While the form is running check if it returns any value, or you get an error
message

Kevin PD said:
Hello,

Hear is the sql, it is just a simple extract from a view in the database.

SELECT informix_v654_vso01_v1_19.reporting_division,
informix_v654_vso01_v1_19.material_division,
informix_v654_vso01_v1_19.branch, informix_v654_vso01_v1_19.order_item,
informix_v654_vso01_v1_19.weight, informix_v654_vso01_v1_19.sales_value,
informix_v654_vso01_v1_19.net_profit, informix_v654_vso01_v1_19.rep_date
FROM informix_v654_vso01_v1_19
WHERE
(((informix_v654_vso01_v1_19.rep_date)=[Forms]![68frmMG01EPrintForm]![ActiveXCtlMin]))
ORDER BY informix_v654_vso01_v1_19.reporting_division,
informix_v654_vso01_v1_19.material_division, informix_v654_vso01_v1_19.branch;


Ofer said:
I understand that the query has a filter with reference to the form.
Select * from MyTable Were DateField = Forms![FormName]![DateFieldName]

Can you post the SQL of qry_205_654f_MG01E_Daily_Sales_Orders, I undertand
that the report is based on it.

Kevin PD said:
Hello,

Here is the open query and print preview code.

Cheers

Kevin PD

Private Sub cmd_Open_MG01E_Query_Button_Click()
On Error GoTo Err_cmd_Open_MG01E_Query_Button_Click

Dim stDocName As String

stDocName = "qry_205_654f_MG01E_Daily_Sales_Orders"
DoCmd.OpenQuery stDocName, acNormal, acEdit

Exit_cmd_Open_MG01E_Query_Button_Click:
Exit Sub

Err_cmd_Open_MG01E_Query_Button_Click:
MsgBox Err.description
Resume Exit_cmd_Open_MG01E_Query_Button_Click

End Sub

Private Sub cmd_Open_MG01E_Report_Button_Click()
On Error GoTo Err_cmd_Open_MG01E_Report_Button_Click

Dim stDocName As String

stDocName = "rpt_205_654f_MG01E_Daily_Sales_Orders"
DoCmd.OpenReport stDocName, acPreview

Exit_cmd_Open_MG01E_Report_Button_Click:
Exit Sub

Err_cmd_Open_MG01E_Report_Button_Click:
MsgBox Err.description
Resume Exit_cmd_Open_MG01E_Report_Button_Click

End Sub

:

Can you post the openreport command you wrote?
That will help us to find a problem, if there is one.



:

Hello,

I have a query and a report based on it, which as standalones work
perfectley. Once I add a command button [using the wizard] to a form they
both then return no data. The parameter being passed from the form is a date.
I have checked every form and button property, they are exactly the same as
the other 40 odd queries/reports in my app. I have deleted the form, query
and reports, rebuilt them etc. I have exported the entire db to a new one and
excluded thse quries/reports/forms but all to no avail.

Can anyone give me some pointers as to where else I should look ?

Thanks
 
The name of the field that returns the data is called "rep_date"

"ActiveXCtlMin" is the name of the text box that the user puts the date in.

When I run the form nothing appears in the immediate window.

Cheers

Kevin PD

Ofer said:
Is the ActiveXCtlMin is the name of the field that return a date?

Run the Immidiate windows (Press Ctrl+G) type
?[Forms]![68frmMG01EPrintForm]![ActiveXCtlMin]
While the form is running check if it returns any value, or you get an error
message

Kevin PD said:
Hello,

Hear is the sql, it is just a simple extract from a view in the database.

SELECT informix_v654_vso01_v1_19.reporting_division,
informix_v654_vso01_v1_19.material_division,
informix_v654_vso01_v1_19.branch, informix_v654_vso01_v1_19.order_item,
informix_v654_vso01_v1_19.weight, informix_v654_vso01_v1_19.sales_value,
informix_v654_vso01_v1_19.net_profit, informix_v654_vso01_v1_19.rep_date
FROM informix_v654_vso01_v1_19
WHERE
(((informix_v654_vso01_v1_19.rep_date)=[Forms]![68frmMG01EPrintForm]![ActiveXCtlMin]))
ORDER BY informix_v654_vso01_v1_19.reporting_division,
informix_v654_vso01_v1_19.material_division, informix_v654_vso01_v1_19.branch;


Ofer said:
I understand that the query has a filter with reference to the form.
Select * from MyTable Were DateField = Forms![FormName]![DateFieldName]

Can you post the SQL of qry_205_654f_MG01E_Daily_Sales_Orders, I undertand
that the report is based on it.

:

Hello,

Here is the open query and print preview code.

Cheers

Kevin PD

Private Sub cmd_Open_MG01E_Query_Button_Click()
On Error GoTo Err_cmd_Open_MG01E_Query_Button_Click

Dim stDocName As String

stDocName = "qry_205_654f_MG01E_Daily_Sales_Orders"
DoCmd.OpenQuery stDocName, acNormal, acEdit

Exit_cmd_Open_MG01E_Query_Button_Click:
Exit Sub

Err_cmd_Open_MG01E_Query_Button_Click:
MsgBox Err.description
Resume Exit_cmd_Open_MG01E_Query_Button_Click

End Sub

Private Sub cmd_Open_MG01E_Report_Button_Click()
On Error GoTo Err_cmd_Open_MG01E_Report_Button_Click

Dim stDocName As String

stDocName = "rpt_205_654f_MG01E_Daily_Sales_Orders"
DoCmd.OpenReport stDocName, acPreview

Exit_cmd_Open_MG01E_Report_Button_Click:
Exit Sub

Err_cmd_Open_MG01E_Report_Button_Click:
MsgBox Err.description
Resume Exit_cmd_Open_MG01E_Report_Button_Click

End Sub

:

Can you post the openreport command you wrote?
That will help us to find a problem, if there is one.



:

Hello,

I have a query and a report based on it, which as standalones work
perfectley. Once I add a command button [using the wizard] to a form they
both then return no data. The parameter being passed from the form is a date.
I have checked every form and button property, they are exactly the same as
the other 40 odd queries/reports in my app. I have deleted the form, query
and reports, rebuilt them etc. I have exported the entire db to a new one and
excluded thse quries/reports/forms but all to no avail.

Can anyone give me some pointers as to where else I should look ?

Thanks
 
What I mean, while the form is running, open the immidiate window, then type
?[Forms]![68frmMG01EPrintForm]![ActiveXCtlMin]
press enter and see if any value returned.

Kevin PD said:
The name of the field that returns the data is called "rep_date"

"ActiveXCtlMin" is the name of the text box that the user puts the date in.

When I run the form nothing appears in the immediate window.

Cheers

Kevin PD

Ofer said:
Is the ActiveXCtlMin is the name of the field that return a date?

Run the Immidiate windows (Press Ctrl+G) type
?[Forms]![68frmMG01EPrintForm]![ActiveXCtlMin]
While the form is running check if it returns any value, or you get an error
message

Kevin PD said:
Hello,

Hear is the sql, it is just a simple extract from a view in the database.

SELECT informix_v654_vso01_v1_19.reporting_division,
informix_v654_vso01_v1_19.material_division,
informix_v654_vso01_v1_19.branch, informix_v654_vso01_v1_19.order_item,
informix_v654_vso01_v1_19.weight, informix_v654_vso01_v1_19.sales_value,
informix_v654_vso01_v1_19.net_profit, informix_v654_vso01_v1_19.rep_date
FROM informix_v654_vso01_v1_19
WHERE
(((informix_v654_vso01_v1_19.rep_date)=[Forms]![68frmMG01EPrintForm]![ActiveXCtlMin]))
ORDER BY informix_v654_vso01_v1_19.reporting_division,
informix_v654_vso01_v1_19.material_division, informix_v654_vso01_v1_19.branch;


:

I understand that the query has a filter with reference to the form.
Select * from MyTable Were DateField = Forms![FormName]![DateFieldName]

Can you post the SQL of qry_205_654f_MG01E_Daily_Sales_Orders, I undertand
that the report is based on it.

:

Hello,

Here is the open query and print preview code.

Cheers

Kevin PD

Private Sub cmd_Open_MG01E_Query_Button_Click()
On Error GoTo Err_cmd_Open_MG01E_Query_Button_Click

Dim stDocName As String

stDocName = "qry_205_654f_MG01E_Daily_Sales_Orders"
DoCmd.OpenQuery stDocName, acNormal, acEdit

Exit_cmd_Open_MG01E_Query_Button_Click:
Exit Sub

Err_cmd_Open_MG01E_Query_Button_Click:
MsgBox Err.description
Resume Exit_cmd_Open_MG01E_Query_Button_Click

End Sub

Private Sub cmd_Open_MG01E_Report_Button_Click()
On Error GoTo Err_cmd_Open_MG01E_Report_Button_Click

Dim stDocName As String

stDocName = "rpt_205_654f_MG01E_Daily_Sales_Orders"
DoCmd.OpenReport stDocName, acPreview

Exit_cmd_Open_MG01E_Report_Button_Click:
Exit Sub

Err_cmd_Open_MG01E_Report_Button_Click:
MsgBox Err.description
Resume Exit_cmd_Open_MG01E_Report_Button_Click

End Sub

:

Can you post the openreport command you wrote?
That will help us to find a problem, if there is one.



:

Hello,

I have a query and a report based on it, which as standalones work
perfectley. Once I add a command button [using the wizard] to a form they
both then return no data. The parameter being passed from the form is a date.
I have checked every form and button property, they are exactly the same as
the other 40 odd queries/reports in my app. I have deleted the form, query
and reports, rebuilt them etc. I have exported the entire db to a new one and
excluded thse quries/reports/forms but all to no avail.

Can anyone give me some pointers as to where else I should look ?

Thanks
 
It come up with NULL.

Ofer said:
What I mean, while the form is running, open the immidiate window, then type
?[Forms]![68frmMG01EPrintForm]![ActiveXCtlMin]
press enter and see if any value returned.

Kevin PD said:
The name of the field that returns the data is called "rep_date"

"ActiveXCtlMin" is the name of the text box that the user puts the date in.

When I run the form nothing appears in the immediate window.

Cheers

Kevin PD

Ofer said:
Is the ActiveXCtlMin is the name of the field that return a date?

Run the Immidiate windows (Press Ctrl+G) type
?[Forms]![68frmMG01EPrintForm]![ActiveXCtlMin]
While the form is running check if it returns any value, or you get an error
message

:

Hello,

Hear is the sql, it is just a simple extract from a view in the database.

SELECT informix_v654_vso01_v1_19.reporting_division,
informix_v654_vso01_v1_19.material_division,
informix_v654_vso01_v1_19.branch, informix_v654_vso01_v1_19.order_item,
informix_v654_vso01_v1_19.weight, informix_v654_vso01_v1_19.sales_value,
informix_v654_vso01_v1_19.net_profit, informix_v654_vso01_v1_19.rep_date
FROM informix_v654_vso01_v1_19
WHERE
(((informix_v654_vso01_v1_19.rep_date)=[Forms]![68frmMG01EPrintForm]![ActiveXCtlMin]))
ORDER BY informix_v654_vso01_v1_19.reporting_division,
informix_v654_vso01_v1_19.material_division, informix_v654_vso01_v1_19.branch;


:

I understand that the query has a filter with reference to the form.
Select * from MyTable Were DateField = Forms![FormName]![DateFieldName]

Can you post the SQL of qry_205_654f_MG01E_Daily_Sales_Orders, I undertand
that the report is based on it.

:

Hello,

Here is the open query and print preview code.

Cheers

Kevin PD

Private Sub cmd_Open_MG01E_Query_Button_Click()
On Error GoTo Err_cmd_Open_MG01E_Query_Button_Click

Dim stDocName As String

stDocName = "qry_205_654f_MG01E_Daily_Sales_Orders"
DoCmd.OpenQuery stDocName, acNormal, acEdit

Exit_cmd_Open_MG01E_Query_Button_Click:
Exit Sub

Err_cmd_Open_MG01E_Query_Button_Click:
MsgBox Err.description
Resume Exit_cmd_Open_MG01E_Query_Button_Click

End Sub

Private Sub cmd_Open_MG01E_Report_Button_Click()
On Error GoTo Err_cmd_Open_MG01E_Report_Button_Click

Dim stDocName As String

stDocName = "rpt_205_654f_MG01E_Daily_Sales_Orders"
DoCmd.OpenReport stDocName, acPreview

Exit_cmd_Open_MG01E_Report_Button_Click:
Exit Sub

Err_cmd_Open_MG01E_Report_Button_Click:
MsgBox Err.description
Resume Exit_cmd_Open_MG01E_Report_Button_Click

End Sub

:

Can you post the openreport command you wrote?
That will help us to find a problem, if there is one.



:

Hello,

I have a query and a report based on it, which as standalones work
perfectley. Once I add a command button [using the wizard] to a form they
both then return no data. The parameter being passed from the form is a date.
I have checked every form and button property, they are exactly the same as
the other 40 odd queries/reports in my app. I have deleted the form, query
and reports, rebuilt them etc. I have exported the entire db to a new one and
excluded thse quries/reports/forms but all to no avail.

Can anyone give me some pointers as to where else I should look ?

Thanks
 
When you ran the immidiate did you enter a date in the field ActiveXCtlMin
If you did then the problem is not with the query, but with the field you
reference to.
Check again the names, you might have a field in the form that called
ActiveXCtlMin but it is not the field with the date in it.
If you didn't enter a date before it then try it again after entering the date

Kevin PD said:
It come up with NULL.

Ofer said:
What I mean, while the form is running, open the immidiate window, then type
?[Forms]![68frmMG01EPrintForm]![ActiveXCtlMin]
press enter and see if any value returned.

Kevin PD said:
The name of the field that returns the data is called "rep_date"

"ActiveXCtlMin" is the name of the text box that the user puts the date in.

When I run the form nothing appears in the immediate window.

Cheers

Kevin PD

:

Is the ActiveXCtlMin is the name of the field that return a date?

Run the Immidiate windows (Press Ctrl+G) type
?[Forms]![68frmMG01EPrintForm]![ActiveXCtlMin]
While the form is running check if it returns any value, or you get an error
message

:

Hello,

Hear is the sql, it is just a simple extract from a view in the database.

SELECT informix_v654_vso01_v1_19.reporting_division,
informix_v654_vso01_v1_19.material_division,
informix_v654_vso01_v1_19.branch, informix_v654_vso01_v1_19.order_item,
informix_v654_vso01_v1_19.weight, informix_v654_vso01_v1_19.sales_value,
informix_v654_vso01_v1_19.net_profit, informix_v654_vso01_v1_19.rep_date
FROM informix_v654_vso01_v1_19
WHERE
(((informix_v654_vso01_v1_19.rep_date)=[Forms]![68frmMG01EPrintForm]![ActiveXCtlMin]))
ORDER BY informix_v654_vso01_v1_19.reporting_division,
informix_v654_vso01_v1_19.material_division, informix_v654_vso01_v1_19.branch;


:

I understand that the query has a filter with reference to the form.
Select * from MyTable Were DateField = Forms![FormName]![DateFieldName]

Can you post the SQL of qry_205_654f_MG01E_Daily_Sales_Orders, I undertand
that the report is based on it.

:

Hello,

Here is the open query and print preview code.

Cheers

Kevin PD

Private Sub cmd_Open_MG01E_Query_Button_Click()
On Error GoTo Err_cmd_Open_MG01E_Query_Button_Click

Dim stDocName As String

stDocName = "qry_205_654f_MG01E_Daily_Sales_Orders"
DoCmd.OpenQuery stDocName, acNormal, acEdit

Exit_cmd_Open_MG01E_Query_Button_Click:
Exit Sub

Err_cmd_Open_MG01E_Query_Button_Click:
MsgBox Err.description
Resume Exit_cmd_Open_MG01E_Query_Button_Click

End Sub

Private Sub cmd_Open_MG01E_Report_Button_Click()
On Error GoTo Err_cmd_Open_MG01E_Report_Button_Click

Dim stDocName As String

stDocName = "rpt_205_654f_MG01E_Daily_Sales_Orders"
DoCmd.OpenReport stDocName, acPreview

Exit_cmd_Open_MG01E_Report_Button_Click:
Exit Sub

Err_cmd_Open_MG01E_Report_Button_Click:
MsgBox Err.description
Resume Exit_cmd_Open_MG01E_Report_Button_Click

End Sub

:

Can you post the openreport command you wrote?
That will help us to find a problem, if there is one.



:

Hello,

I have a query and a report based on it, which as standalones work
perfectley. Once I add a command button [using the wizard] to a form they
both then return no data. The parameter being passed from the form is a date.
I have checked every form and button property, they are exactly the same as
the other 40 odd queries/reports in my app. I have deleted the form, query
and reports, rebuilt them etc. I have exported the entire db to a new one and
excluded thse quries/reports/forms but all to no avail.

Can anyone give me some pointers as to where else I should look ?

Thanks
 
When I open the form, put no date in, run immediate it gives Null. Close
form, reopen form, put in date, run immediate and now I get the date that I
entered on the form.

A dog chaseing it's tail is coming to my mind here !

Kevin PD

Ofer said:
When you ran the immidiate did you enter a date in the field ActiveXCtlMin
If you did then the problem is not with the query, but with the field you
reference to.
Check again the names, you might have a field in the form that called
ActiveXCtlMin but it is not the field with the date in it.
If you didn't enter a date before it then try it again after entering the date

Kevin PD said:
It come up with NULL.

Ofer said:
What I mean, while the form is running, open the immidiate window, then type
?[Forms]![68frmMG01EPrintForm]![ActiveXCtlMin]
press enter and see if any value returned.

:

The name of the field that returns the data is called "rep_date"

"ActiveXCtlMin" is the name of the text box that the user puts the date in.

When I run the form nothing appears in the immediate window.

Cheers

Kevin PD

:

Is the ActiveXCtlMin is the name of the field that return a date?

Run the Immidiate windows (Press Ctrl+G) type
?[Forms]![68frmMG01EPrintForm]![ActiveXCtlMin]
While the form is running check if it returns any value, or you get an error
message

:

Hello,

Hear is the sql, it is just a simple extract from a view in the database.

SELECT informix_v654_vso01_v1_19.reporting_division,
informix_v654_vso01_v1_19.material_division,
informix_v654_vso01_v1_19.branch, informix_v654_vso01_v1_19.order_item,
informix_v654_vso01_v1_19.weight, informix_v654_vso01_v1_19.sales_value,
informix_v654_vso01_v1_19.net_profit, informix_v654_vso01_v1_19.rep_date
FROM informix_v654_vso01_v1_19
WHERE
(((informix_v654_vso01_v1_19.rep_date)=[Forms]![68frmMG01EPrintForm]![ActiveXCtlMin]))
ORDER BY informix_v654_vso01_v1_19.reporting_division,
informix_v654_vso01_v1_19.material_division, informix_v654_vso01_v1_19.branch;


:

I understand that the query has a filter with reference to the form.
Select * from MyTable Were DateField = Forms![FormName]![DateFieldName]

Can you post the SQL of qry_205_654f_MG01E_Daily_Sales_Orders, I undertand
that the report is based on it.

:

Hello,

Here is the open query and print preview code.

Cheers

Kevin PD

Private Sub cmd_Open_MG01E_Query_Button_Click()
On Error GoTo Err_cmd_Open_MG01E_Query_Button_Click

Dim stDocName As String

stDocName = "qry_205_654f_MG01E_Daily_Sales_Orders"
DoCmd.OpenQuery stDocName, acNormal, acEdit

Exit_cmd_Open_MG01E_Query_Button_Click:
Exit Sub

Err_cmd_Open_MG01E_Query_Button_Click:
MsgBox Err.description
Resume Exit_cmd_Open_MG01E_Query_Button_Click

End Sub

Private Sub cmd_Open_MG01E_Report_Button_Click()
On Error GoTo Err_cmd_Open_MG01E_Report_Button_Click

Dim stDocName As String

stDocName = "rpt_205_654f_MG01E_Daily_Sales_Orders"
DoCmd.OpenReport stDocName, acPreview

Exit_cmd_Open_MG01E_Report_Button_Click:
Exit Sub

Err_cmd_Open_MG01E_Report_Button_Click:
MsgBox Err.description
Resume Exit_cmd_Open_MG01E_Report_Button_Click

End Sub

:

Can you post the openreport command you wrote?
That will help us to find a problem, if there is one.



:

Hello,

I have a query and a report based on it, which as standalones work
perfectley. Once I add a command button [using the wizard] to a form they
both then return no data. The parameter being passed from the form is a date.
I have checked every form and button property, they are exactly the same as
the other 40 odd queries/reports in my app. I have deleted the form, query
and reports, rebuilt them etc. I have exported the entire db to a new one and
excluded thse quries/reports/forms but all to no avail.

Can anyone give me some pointers as to where else I should look ?

Thanks
 
I have now tried the same with several other forms that do work and they give
me the same result, the only difference being that when I run the
queries/reports from these forms they work.

Incressingly get confused and annoyed by this now.

Kevin

Ofer said:
When you ran the immidiate did you enter a date in the field ActiveXCtlMin
If you did then the problem is not with the query, but with the field you
reference to.
Check again the names, you might have a field in the form that called
ActiveXCtlMin but it is not the field with the date in it.
If you didn't enter a date before it then try it again after entering the date

Kevin PD said:
It come up with NULL.

Ofer said:
What I mean, while the form is running, open the immidiate window, then type
?[Forms]![68frmMG01EPrintForm]![ActiveXCtlMin]
press enter and see if any value returned.

:

The name of the field that returns the data is called "rep_date"

"ActiveXCtlMin" is the name of the text box that the user puts the date in.

When I run the form nothing appears in the immediate window.

Cheers

Kevin PD

:

Is the ActiveXCtlMin is the name of the field that return a date?

Run the Immidiate windows (Press Ctrl+G) type
?[Forms]![68frmMG01EPrintForm]![ActiveXCtlMin]
While the form is running check if it returns any value, or you get an error
message

:

Hello,

Hear is the sql, it is just a simple extract from a view in the database.

SELECT informix_v654_vso01_v1_19.reporting_division,
informix_v654_vso01_v1_19.material_division,
informix_v654_vso01_v1_19.branch, informix_v654_vso01_v1_19.order_item,
informix_v654_vso01_v1_19.weight, informix_v654_vso01_v1_19.sales_value,
informix_v654_vso01_v1_19.net_profit, informix_v654_vso01_v1_19.rep_date
FROM informix_v654_vso01_v1_19
WHERE
(((informix_v654_vso01_v1_19.rep_date)=[Forms]![68frmMG01EPrintForm]![ActiveXCtlMin]))
ORDER BY informix_v654_vso01_v1_19.reporting_division,
informix_v654_vso01_v1_19.material_division, informix_v654_vso01_v1_19.branch;


:

I understand that the query has a filter with reference to the form.
Select * from MyTable Were DateField = Forms![FormName]![DateFieldName]

Can you post the SQL of qry_205_654f_MG01E_Daily_Sales_Orders, I undertand
that the report is based on it.

:

Hello,

Here is the open query and print preview code.

Cheers

Kevin PD

Private Sub cmd_Open_MG01E_Query_Button_Click()
On Error GoTo Err_cmd_Open_MG01E_Query_Button_Click

Dim stDocName As String

stDocName = "qry_205_654f_MG01E_Daily_Sales_Orders"
DoCmd.OpenQuery stDocName, acNormal, acEdit

Exit_cmd_Open_MG01E_Query_Button_Click:
Exit Sub

Err_cmd_Open_MG01E_Query_Button_Click:
MsgBox Err.description
Resume Exit_cmd_Open_MG01E_Query_Button_Click

End Sub

Private Sub cmd_Open_MG01E_Report_Button_Click()
On Error GoTo Err_cmd_Open_MG01E_Report_Button_Click

Dim stDocName As String

stDocName = "rpt_205_654f_MG01E_Daily_Sales_Orders"
DoCmd.OpenReport stDocName, acPreview

Exit_cmd_Open_MG01E_Report_Button_Click:
Exit Sub

Err_cmd_Open_MG01E_Report_Button_Click:
MsgBox Err.description
Resume Exit_cmd_Open_MG01E_Report_Button_Click

End Sub

:

Can you post the openreport command you wrote?
That will help us to find a problem, if there is one.



:

Hello,

I have a query and a report based on it, which as standalones work
perfectley. Once I add a command button [using the wizard] to a form they
both then return no data. The parameter being passed from the form is a date.
I have checked every form and button property, they are exactly the same as
the other 40 odd queries/reports in my app. I have deleted the form, query
and reports, rebuilt them etc. I have exported the entire db to a new one and
excluded thse quries/reports/forms but all to no avail.

Can anyone give me some pointers as to where else I should look ?

Thanks
 
It is very hard without looking at your mdb, would you like to post it to my
Address
(e-mail address removed)
If you want to then, compact the mdb and change the type from mdb to bmp and
send it, hotmail would remove the mdb.

Kevin PD said:
I have now tried the same with several other forms that do work and they give
me the same result, the only difference being that when I run the
queries/reports from these forms they work.

Incressingly get confused and annoyed by this now.

Kevin

Ofer said:
When you ran the immidiate did you enter a date in the field ActiveXCtlMin
If you did then the problem is not with the query, but with the field you
reference to.
Check again the names, you might have a field in the form that called
ActiveXCtlMin but it is not the field with the date in it.
If you didn't enter a date before it then try it again after entering the date

Kevin PD said:
It come up with NULL.

:

What I mean, while the form is running, open the immidiate window, then type
?[Forms]![68frmMG01EPrintForm]![ActiveXCtlMin]
press enter and see if any value returned.

:

The name of the field that returns the data is called "rep_date"

"ActiveXCtlMin" is the name of the text box that the user puts the date in.

When I run the form nothing appears in the immediate window.

Cheers

Kevin PD

:

Is the ActiveXCtlMin is the name of the field that return a date?

Run the Immidiate windows (Press Ctrl+G) type
?[Forms]![68frmMG01EPrintForm]![ActiveXCtlMin]
While the form is running check if it returns any value, or you get an error
message

:

Hello,

Hear is the sql, it is just a simple extract from a view in the database.

SELECT informix_v654_vso01_v1_19.reporting_division,
informix_v654_vso01_v1_19.material_division,
informix_v654_vso01_v1_19.branch, informix_v654_vso01_v1_19.order_item,
informix_v654_vso01_v1_19.weight, informix_v654_vso01_v1_19.sales_value,
informix_v654_vso01_v1_19.net_profit, informix_v654_vso01_v1_19.rep_date
FROM informix_v654_vso01_v1_19
WHERE
(((informix_v654_vso01_v1_19.rep_date)=[Forms]![68frmMG01EPrintForm]![ActiveXCtlMin]))
ORDER BY informix_v654_vso01_v1_19.reporting_division,
informix_v654_vso01_v1_19.material_division, informix_v654_vso01_v1_19.branch;


:

I understand that the query has a filter with reference to the form.
Select * from MyTable Were DateField = Forms![FormName]![DateFieldName]

Can you post the SQL of qry_205_654f_MG01E_Daily_Sales_Orders, I undertand
that the report is based on it.

:

Hello,

Here is the open query and print preview code.

Cheers

Kevin PD

Private Sub cmd_Open_MG01E_Query_Button_Click()
On Error GoTo Err_cmd_Open_MG01E_Query_Button_Click

Dim stDocName As String

stDocName = "qry_205_654f_MG01E_Daily_Sales_Orders"
DoCmd.OpenQuery stDocName, acNormal, acEdit

Exit_cmd_Open_MG01E_Query_Button_Click:
Exit Sub

Err_cmd_Open_MG01E_Query_Button_Click:
MsgBox Err.description
Resume Exit_cmd_Open_MG01E_Query_Button_Click

End Sub

Private Sub cmd_Open_MG01E_Report_Button_Click()
On Error GoTo Err_cmd_Open_MG01E_Report_Button_Click

Dim stDocName As String

stDocName = "rpt_205_654f_MG01E_Daily_Sales_Orders"
DoCmd.OpenReport stDocName, acPreview

Exit_cmd_Open_MG01E_Report_Button_Click:
Exit Sub

Err_cmd_Open_MG01E_Report_Button_Click:
MsgBox Err.description
Resume Exit_cmd_Open_MG01E_Report_Button_Click

End Sub

:

Can you post the openreport command you wrote?
That will help us to find a problem, if there is one.



:

Hello,

I have a query and a report based on it, which as standalones work
perfectley. Once I add a command button [using the wizard] to a form they
both then return no data. The parameter being passed from the form is a date.
I have checked every form and button property, they are exactly the same as
the other 40 odd queries/reports in my app. I have deleted the form, query
and reports, rebuilt them etc. I have exported the entire db to a new one and
excluded thse quries/reports/forms but all to no avail.

Can anyone give me some pointers as to where else I should look ?

Thanks
 
db is over 29 mb compacted, will move form, query and report into new db and
send this.

Thanks for all your help so far, it is much appreciated.

Kevin PD

Ofer said:
It is very hard without looking at your mdb, would you like to post it to my
Address
(e-mail address removed)
If you want to then, compact the mdb and change the type from mdb to bmp and
send it, hotmail would remove the mdb.

Kevin PD said:
I have now tried the same with several other forms that do work and they give
me the same result, the only difference being that when I run the
queries/reports from these forms they work.

Incressingly get confused and annoyed by this now.

Kevin

Ofer said:
When you ran the immidiate did you enter a date in the field ActiveXCtlMin
If you did then the problem is not with the query, but with the field you
reference to.
Check again the names, you might have a field in the form that called
ActiveXCtlMin but it is not the field with the date in it.
If you didn't enter a date before it then try it again after entering the date

:

It come up with NULL.

:

What I mean, while the form is running, open the immidiate window, then type
?[Forms]![68frmMG01EPrintForm]![ActiveXCtlMin]
press enter and see if any value returned.

:

The name of the field that returns the data is called "rep_date"

"ActiveXCtlMin" is the name of the text box that the user puts the date in.

When I run the form nothing appears in the immediate window.

Cheers

Kevin PD

:

Is the ActiveXCtlMin is the name of the field that return a date?

Run the Immidiate windows (Press Ctrl+G) type
?[Forms]![68frmMG01EPrintForm]![ActiveXCtlMin]
While the form is running check if it returns any value, or you get an error
message

:

Hello,

Hear is the sql, it is just a simple extract from a view in the database.

SELECT informix_v654_vso01_v1_19.reporting_division,
informix_v654_vso01_v1_19.material_division,
informix_v654_vso01_v1_19.branch, informix_v654_vso01_v1_19.order_item,
informix_v654_vso01_v1_19.weight, informix_v654_vso01_v1_19.sales_value,
informix_v654_vso01_v1_19.net_profit, informix_v654_vso01_v1_19.rep_date
FROM informix_v654_vso01_v1_19
WHERE
(((informix_v654_vso01_v1_19.rep_date)=[Forms]![68frmMG01EPrintForm]![ActiveXCtlMin]))
ORDER BY informix_v654_vso01_v1_19.reporting_division,
informix_v654_vso01_v1_19.material_division, informix_v654_vso01_v1_19.branch;


:

I understand that the query has a filter with reference to the form.
Select * from MyTable Were DateField = Forms![FormName]![DateFieldName]

Can you post the SQL of qry_205_654f_MG01E_Daily_Sales_Orders, I undertand
that the report is based on it.

:

Hello,

Here is the open query and print preview code.

Cheers

Kevin PD

Private Sub cmd_Open_MG01E_Query_Button_Click()
On Error GoTo Err_cmd_Open_MG01E_Query_Button_Click

Dim stDocName As String

stDocName = "qry_205_654f_MG01E_Daily_Sales_Orders"
DoCmd.OpenQuery stDocName, acNormal, acEdit

Exit_cmd_Open_MG01E_Query_Button_Click:
Exit Sub

Err_cmd_Open_MG01E_Query_Button_Click:
MsgBox Err.description
Resume Exit_cmd_Open_MG01E_Query_Button_Click

End Sub

Private Sub cmd_Open_MG01E_Report_Button_Click()
On Error GoTo Err_cmd_Open_MG01E_Report_Button_Click

Dim stDocName As String

stDocName = "rpt_205_654f_MG01E_Daily_Sales_Orders"
DoCmd.OpenReport stDocName, acPreview

Exit_cmd_Open_MG01E_Report_Button_Click:
Exit Sub

Err_cmd_Open_MG01E_Report_Button_Click:
MsgBox Err.description
Resume Exit_cmd_Open_MG01E_Report_Button_Click

End Sub

:

Can you post the openreport command you wrote?
That will help us to find a problem, if there is one.



:

Hello,

I have a query and a report based on it, which as standalones work
perfectley. Once I add a command button [using the wizard] to a form they
both then return no data. The parameter being passed from the form is a date.
I have checked every form and button property, they are exactly the same as
the other 40 odd queries/reports in my app. I have deleted the form, query
and reports, rebuilt them etc. I have exported the entire db to a new one and
excluded thse quries/reports/forms but all to no avail.

Can anyone give me some pointers as to where else I should look ?

Thanks
 
I got it
I see you using a control for the date, is it necessary, can't you use a
text box with default =date()-1 , If you want the user to enter yesterday
date.

I can't test it becuse you sent a link table.

Kevin PD said:
db is over 29 mb compacted, will move form, query and report into new db and
send this.

Thanks for all your help so far, it is much appreciated.

Kevin PD

Ofer said:
It is very hard without looking at your mdb, would you like to post it to my
Address
(e-mail address removed)
If you want to then, compact the mdb and change the type from mdb to bmp and
send it, hotmail would remove the mdb.

Kevin PD said:
I have now tried the same with several other forms that do work and they give
me the same result, the only difference being that when I run the
queries/reports from these forms they work.

Incressingly get confused and annoyed by this now.

Kevin

:

When you ran the immidiate did you enter a date in the field ActiveXCtlMin
If you did then the problem is not with the query, but with the field you
reference to.
Check again the names, you might have a field in the form that called
ActiveXCtlMin but it is not the field with the date in it.
If you didn't enter a date before it then try it again after entering the date

:

It come up with NULL.

:

What I mean, while the form is running, open the immidiate window, then type
?[Forms]![68frmMG01EPrintForm]![ActiveXCtlMin]
press enter and see if any value returned.

:

The name of the field that returns the data is called "rep_date"

"ActiveXCtlMin" is the name of the text box that the user puts the date in.

When I run the form nothing appears in the immediate window.

Cheers

Kevin PD

:

Is the ActiveXCtlMin is the name of the field that return a date?

Run the Immidiate windows (Press Ctrl+G) type
?[Forms]![68frmMG01EPrintForm]![ActiveXCtlMin]
While the form is running check if it returns any value, or you get an error
message

:

Hello,

Hear is the sql, it is just a simple extract from a view in the database.

SELECT informix_v654_vso01_v1_19.reporting_division,
informix_v654_vso01_v1_19.material_division,
informix_v654_vso01_v1_19.branch, informix_v654_vso01_v1_19.order_item,
informix_v654_vso01_v1_19.weight, informix_v654_vso01_v1_19.sales_value,
informix_v654_vso01_v1_19.net_profit, informix_v654_vso01_v1_19.rep_date
FROM informix_v654_vso01_v1_19
WHERE
(((informix_v654_vso01_v1_19.rep_date)=[Forms]![68frmMG01EPrintForm]![ActiveXCtlMin]))
ORDER BY informix_v654_vso01_v1_19.reporting_division,
informix_v654_vso01_v1_19.material_division, informix_v654_vso01_v1_19.branch;


:

I understand that the query has a filter with reference to the form.
Select * from MyTable Were DateField = Forms![FormName]![DateFieldName]

Can you post the SQL of qry_205_654f_MG01E_Daily_Sales_Orders, I undertand
that the report is based on it.

:

Hello,

Here is the open query and print preview code.

Cheers

Kevin PD

Private Sub cmd_Open_MG01E_Query_Button_Click()
On Error GoTo Err_cmd_Open_MG01E_Query_Button_Click

Dim stDocName As String

stDocName = "qry_205_654f_MG01E_Daily_Sales_Orders"
DoCmd.OpenQuery stDocName, acNormal, acEdit

Exit_cmd_Open_MG01E_Query_Button_Click:
Exit Sub

Err_cmd_Open_MG01E_Query_Button_Click:
MsgBox Err.description
Resume Exit_cmd_Open_MG01E_Query_Button_Click

End Sub

Private Sub cmd_Open_MG01E_Report_Button_Click()
On Error GoTo Err_cmd_Open_MG01E_Report_Button_Click

Dim stDocName As String

stDocName = "rpt_205_654f_MG01E_Daily_Sales_Orders"
DoCmd.OpenReport stDocName, acPreview

Exit_cmd_Open_MG01E_Report_Button_Click:
Exit Sub

Err_cmd_Open_MG01E_Report_Button_Click:
MsgBox Err.description
Resume Exit_cmd_Open_MG01E_Report_Button_Click

End Sub

:

Can you post the openreport command you wrote?
That will help us to find a problem, if there is one.



:

Hello,

I have a query and a report based on it, which as standalones work
perfectley. Once I add a command button [using the wizard] to a form they
both then return no data. The parameter being passed from the form is a date.
I have checked every form and button property, they are exactly the same as
the other 40 odd queries/reports in my app. I have deleted the form, query
and reports, rebuilt them etc. I have exported the entire db to a new one and
excluded thse quries/reports/forms but all to no avail.

Can anyone give me some pointers as to where else I should look ?

Thanks
 
One more try, I can't see anything wrong with the query, but I can see that
the tables are linked to another mdb.
I work with SQL Server and sometimes when I run queries, the sql ask for a
different format for the date, ao I set the same format for the criteria

So try:
WHERE
Format(informix_v654_vso01_v1_19.rep_date,"dd/mm/yyyy")=format([Forms]![68frmMG01EPrintForm]![ActiveXCtlMin],"dd/mm/yyyy")

Kevin PD said:
db is over 29 mb compacted, will move form, query and report into new db and
send this.

Thanks for all your help so far, it is much appreciated.

Kevin PD

Ofer said:
It is very hard without looking at your mdb, would you like to post it to my
Address
(e-mail address removed)
If you want to then, compact the mdb and change the type from mdb to bmp and
send it, hotmail would remove the mdb.

Kevin PD said:
I have now tried the same with several other forms that do work and they give
me the same result, the only difference being that when I run the
queries/reports from these forms they work.

Incressingly get confused and annoyed by this now.

Kevin

:

When you ran the immidiate did you enter a date in the field ActiveXCtlMin
If you did then the problem is not with the query, but with the field you
reference to.
Check again the names, you might have a field in the form that called
ActiveXCtlMin but it is not the field with the date in it.
If you didn't enter a date before it then try it again after entering the date

:

It come up with NULL.

:

What I mean, while the form is running, open the immidiate window, then type
?[Forms]![68frmMG01EPrintForm]![ActiveXCtlMin]
press enter and see if any value returned.

:

The name of the field that returns the data is called "rep_date"

"ActiveXCtlMin" is the name of the text box that the user puts the date in.

When I run the form nothing appears in the immediate window.

Cheers

Kevin PD

:

Is the ActiveXCtlMin is the name of the field that return a date?

Run the Immidiate windows (Press Ctrl+G) type
?[Forms]![68frmMG01EPrintForm]![ActiveXCtlMin]
While the form is running check if it returns any value, or you get an error
message

:

Hello,

Hear is the sql, it is just a simple extract from a view in the database.

SELECT informix_v654_vso01_v1_19.reporting_division,
informix_v654_vso01_v1_19.material_division,
informix_v654_vso01_v1_19.branch, informix_v654_vso01_v1_19.order_item,
informix_v654_vso01_v1_19.weight, informix_v654_vso01_v1_19.sales_value,
informix_v654_vso01_v1_19.net_profit, informix_v654_vso01_v1_19.rep_date
FROM informix_v654_vso01_v1_19
WHERE
(((informix_v654_vso01_v1_19.rep_date)=[Forms]![68frmMG01EPrintForm]![ActiveXCtlMin]))
ORDER BY informix_v654_vso01_v1_19.reporting_division,
informix_v654_vso01_v1_19.material_division, informix_v654_vso01_v1_19.branch;


:

I understand that the query has a filter with reference to the form.
Select * from MyTable Were DateField = Forms![FormName]![DateFieldName]

Can you post the SQL of qry_205_654f_MG01E_Daily_Sales_Orders, I undertand
that the report is based on it.

:

Hello,

Here is the open query and print preview code.

Cheers

Kevin PD

Private Sub cmd_Open_MG01E_Query_Button_Click()
On Error GoTo Err_cmd_Open_MG01E_Query_Button_Click

Dim stDocName As String

stDocName = "qry_205_654f_MG01E_Daily_Sales_Orders"
DoCmd.OpenQuery stDocName, acNormal, acEdit

Exit_cmd_Open_MG01E_Query_Button_Click:
Exit Sub

Err_cmd_Open_MG01E_Query_Button_Click:
MsgBox Err.description
Resume Exit_cmd_Open_MG01E_Query_Button_Click

End Sub

Private Sub cmd_Open_MG01E_Report_Button_Click()
On Error GoTo Err_cmd_Open_MG01E_Report_Button_Click

Dim stDocName As String

stDocName = "rpt_205_654f_MG01E_Daily_Sales_Orders"
DoCmd.OpenReport stDocName, acPreview

Exit_cmd_Open_MG01E_Report_Button_Click:
Exit Sub

Err_cmd_Open_MG01E_Report_Button_Click:
MsgBox Err.description
Resume Exit_cmd_Open_MG01E_Report_Button_Click

End Sub

:

Can you post the openreport command you wrote?
That will help us to find a problem, if there is one.



:

Hello,

I have a query and a report based on it, which as standalones work
perfectley. Once I add a command button [using the wizard] to a form they
both then return no data. The parameter being passed from the form is a date.
I have checked every form and button property, they are exactly the same as
the other 40 odd queries/reports in my app. I have deleted the form, query
and reports, rebuilt them etc. I have exported the entire db to a new one and
excluded thse quries/reports/forms but all to no avail.

Can anyone give me some pointers as to where else I should look ?

Thanks
 
Excellent !!!!

I can now stop head butting my screen on this one.

Thanks very much for your help and I owe you a drink !!!!!!!

Kevin PD


Ofer said:
One more try, I can't see anything wrong with the query, but I can see that
the tables are linked to another mdb.
I work with SQL Server and sometimes when I run queries, the sql ask for a
different format for the date, ao I set the same format for the criteria

So try:
WHERE
Format(informix_v654_vso01_v1_19.rep_date,"dd/mm/yyyy")=format([Forms]![68frmMG01EPrintForm]![ActiveXCtlMin],"dd/mm/yyyy")

Kevin PD said:
db is over 29 mb compacted, will move form, query and report into new db and
send this.

Thanks for all your help so far, it is much appreciated.

Kevin PD

Ofer said:
It is very hard without looking at your mdb, would you like to post it to my
Address
(e-mail address removed)
If you want to then, compact the mdb and change the type from mdb to bmp and
send it, hotmail would remove the mdb.

:

I have now tried the same with several other forms that do work and they give
me the same result, the only difference being that when I run the
queries/reports from these forms they work.

Incressingly get confused and annoyed by this now.

Kevin

:

When you ran the immidiate did you enter a date in the field ActiveXCtlMin
If you did then the problem is not with the query, but with the field you
reference to.
Check again the names, you might have a field in the form that called
ActiveXCtlMin but it is not the field with the date in it.
If you didn't enter a date before it then try it again after entering the date

:

It come up with NULL.

:

What I mean, while the form is running, open the immidiate window, then type
?[Forms]![68frmMG01EPrintForm]![ActiveXCtlMin]
press enter and see if any value returned.

:

The name of the field that returns the data is called "rep_date"

"ActiveXCtlMin" is the name of the text box that the user puts the date in.

When I run the form nothing appears in the immediate window.

Cheers

Kevin PD

:

Is the ActiveXCtlMin is the name of the field that return a date?

Run the Immidiate windows (Press Ctrl+G) type
?[Forms]![68frmMG01EPrintForm]![ActiveXCtlMin]
While the form is running check if it returns any value, or you get an error
message

:

Hello,

Hear is the sql, it is just a simple extract from a view in the database.

SELECT informix_v654_vso01_v1_19.reporting_division,
informix_v654_vso01_v1_19.material_division,
informix_v654_vso01_v1_19.branch, informix_v654_vso01_v1_19.order_item,
informix_v654_vso01_v1_19.weight, informix_v654_vso01_v1_19.sales_value,
informix_v654_vso01_v1_19.net_profit, informix_v654_vso01_v1_19.rep_date
FROM informix_v654_vso01_v1_19
WHERE
(((informix_v654_vso01_v1_19.rep_date)=[Forms]![68frmMG01EPrintForm]![ActiveXCtlMin]))
ORDER BY informix_v654_vso01_v1_19.reporting_division,
informix_v654_vso01_v1_19.material_division, informix_v654_vso01_v1_19.branch;


:

I understand that the query has a filter with reference to the form.
Select * from MyTable Were DateField = Forms![FormName]![DateFieldName]

Can you post the SQL of qry_205_654f_MG01E_Daily_Sales_Orders, I undertand
that the report is based on it.

:

Hello,

Here is the open query and print preview code.

Cheers

Kevin PD

Private Sub cmd_Open_MG01E_Query_Button_Click()
On Error GoTo Err_cmd_Open_MG01E_Query_Button_Click

Dim stDocName As String

stDocName = "qry_205_654f_MG01E_Daily_Sales_Orders"
DoCmd.OpenQuery stDocName, acNormal, acEdit

Exit_cmd_Open_MG01E_Query_Button_Click:
Exit Sub

Err_cmd_Open_MG01E_Query_Button_Click:
MsgBox Err.description
Resume Exit_cmd_Open_MG01E_Query_Button_Click

End Sub

Private Sub cmd_Open_MG01E_Report_Button_Click()
On Error GoTo Err_cmd_Open_MG01E_Report_Button_Click

Dim stDocName As String

stDocName = "rpt_205_654f_MG01E_Daily_Sales_Orders"
DoCmd.OpenReport stDocName, acPreview

Exit_cmd_Open_MG01E_Report_Button_Click:
Exit Sub

Err_cmd_Open_MG01E_Report_Button_Click:
MsgBox Err.description
Resume Exit_cmd_Open_MG01E_Report_Button_Click

End Sub

:

Can you post the openreport command you wrote?
That will help us to find a problem, if there is one.



:

Hello,

I have a query and a report based on it, which as standalones work
perfectley. Once I add a command button [using the wizard] to a form they
both then return no data. The parameter being passed from the form is a date.
I have checked every form and button property, they are exactly the same as
the other 40 odd queries/reports in my app. I have deleted the form, query
and reports, rebuilt them etc. I have exported the entire db to a new one and
excluded thse quries/reports/forms but all to no avail.

Can anyone give me some pointers as to where else I should look ?

Thanks
 
Back
Top