D
doglover
Geoff:
From my previous e-mail I noticed a mistake in the code I relayed.
The code below is missing a piece
1.) after Me!ChooseJob.Requery
add: Me.Requery
End Sub
2.) Something else that is strange. I was reviewing the frmInvoiceSelect
2003 version compared to 97 version. Specifically, the query resource behind
the unbound combo box on the form header Name: ChooseJob. This query has the
criteria Like nz([forms]![frmInvoiceSelect]![ChooseCust],"*") and I decided
to run the query in the design view and I received an error message ...
invalid syntax refering TO brackets. I looked and looked at the query in
design view but no error with the syntax was visible. So I changed the
view to SQL and the code was: PARAMETERS
[[forms]]!frmInvoiceSelect![[ChooseCust]] Text (255); The balance of the code
was equal to the current text that follows in the next paragraph.
So I removed the double brackets around forms and ChooseCust and this is the
code that is now in the SQL view for this query which runs with no error
message but the form still has the same problem as before the detail is not
synchronized with the combo boxes on the form header.
PARAMETERS [forms]!frmInvoiceSelect![ChooseCust] Text ( 255 );
SELECT DISTINCT tblJob.jobID, tblJob.jobnm, tblJob.jobdt_start
FROM tblJob INNER JOIN tblWorkOrder ON tblJob.jobID=tblWorkOrder.wrkky_jobid
WHERE (((tblWorkOrder.wrkdt_comp) Is Not Null) And ((tblJob.jobKy_CusNm)
Like nz(forms!frmInvoiceSelect!ChooseCust,"*")) And
((tblWorkOrder.wrkky_invno) Is Null Or (tblWorkOrder.wrkky_invno)=0 Or
(tblWorkOrder.wrkky_invno)=-1))
ORDER BY tblJob.jobID;
Code for version 97 is:
PARAMETERS forms!frmInvoiceSelect!ChooseCust Text;
SELECT DISTINCT tblJob.jobID, tblJob.jobnm, tblJob.jobdt_start
FROM tblJob INNER JOIN tblWorkOrder ON tblJob.jobID = tblWorkOrder.wrkky_jobid
WHERE (((tblWorkOrder.wrkdt_comp) Is Not Null) AND ((tblJob.jobKy_CusNm)
Like nz([forms]![frmInvoiceSelect]![ChooseCust],"*")) AND
((tblWorkOrder.wrkky_invno) Is Null Or (tblWorkOrder.wrkky_invno)=0 Or
(tblWorkOrder.wrkky_invno)=-1))
ORDER BY tblJob.jobID;
In case you are wondering, I copied and pasted the code from each module
rather than trying to type with no errors.
I am wondering if there is a problem deeper than just the forms but the code
source that provides instructions to the expressions, etc. If you recall I
indicated that the expression in the on click event is different from version
97 database.
version 2003: =zfSortLabel("tktno",Screen.ActiveForm)
version 97: =zfSortLabel("tktno",[Screen].[ActiveForm])
If you type in the missing brackets on the zfSortLabel, etc for version 2003
and close the screen the replaed bracket go away but no error message ever
appears.
The database I am working with uses the execution file from a retail version
of access 2003 but I noticed under the option, Default File Format "Access
2000" is selected rather than the other option of "Access 2002-2003."
This might be more information than needed I just seemed important, so I am
sending to you.
Once again, I thank you for your help.
Regards,
doglover
From my previous e-mail I noticed a mistake in the code I relayed.
The code below is missing a piece
1.) after Me!ChooseJob.Requery
add: Me.Requery
End Sub
2.) Something else that is strange. I was reviewing the frmInvoiceSelect
2003 version compared to 97 version. Specifically, the query resource behind
the unbound combo box on the form header Name: ChooseJob. This query has the
criteria Like nz([forms]![frmInvoiceSelect]![ChooseCust],"*") and I decided
to run the query in the design view and I received an error message ...
invalid syntax refering TO brackets. I looked and looked at the query in
design view but no error with the syntax was visible. So I changed the
view to SQL and the code was: PARAMETERS
[[forms]]!frmInvoiceSelect![[ChooseCust]] Text (255); The balance of the code
was equal to the current text that follows in the next paragraph.
So I removed the double brackets around forms and ChooseCust and this is the
code that is now in the SQL view for this query which runs with no error
message but the form still has the same problem as before the detail is not
synchronized with the combo boxes on the form header.
PARAMETERS [forms]!frmInvoiceSelect![ChooseCust] Text ( 255 );
SELECT DISTINCT tblJob.jobID, tblJob.jobnm, tblJob.jobdt_start
FROM tblJob INNER JOIN tblWorkOrder ON tblJob.jobID=tblWorkOrder.wrkky_jobid
WHERE (((tblWorkOrder.wrkdt_comp) Is Not Null) And ((tblJob.jobKy_CusNm)
Like nz(forms!frmInvoiceSelect!ChooseCust,"*")) And
((tblWorkOrder.wrkky_invno) Is Null Or (tblWorkOrder.wrkky_invno)=0 Or
(tblWorkOrder.wrkky_invno)=-1))
ORDER BY tblJob.jobID;
Code for version 97 is:
PARAMETERS forms!frmInvoiceSelect!ChooseCust Text;
SELECT DISTINCT tblJob.jobID, tblJob.jobnm, tblJob.jobdt_start
FROM tblJob INNER JOIN tblWorkOrder ON tblJob.jobID = tblWorkOrder.wrkky_jobid
WHERE (((tblWorkOrder.wrkdt_comp) Is Not Null) AND ((tblJob.jobKy_CusNm)
Like nz([forms]![frmInvoiceSelect]![ChooseCust],"*")) AND
((tblWorkOrder.wrkky_invno) Is Null Or (tblWorkOrder.wrkky_invno)=0 Or
(tblWorkOrder.wrkky_invno)=-1))
ORDER BY tblJob.jobID;
In case you are wondering, I copied and pasted the code from each module
rather than trying to type with no errors.
I am wondering if there is a problem deeper than just the forms but the code
source that provides instructions to the expressions, etc. If you recall I
indicated that the expression in the on click event is different from version
97 database.
version 2003: =zfSortLabel("tktno",Screen.ActiveForm)
version 97: =zfSortLabel("tktno",[Screen].[ActiveForm])
If you type in the missing brackets on the zfSortLabel, etc for version 2003
and close the screen the replaed bracket go away but no error message ever
appears.
The database I am working with uses the execution file from a retail version
of access 2003 but I noticed under the option, Default File Format "Access
2000" is selected rather than the other option of "Access 2002-2003."
This might be more information than needed I just seemed important, so I am
sending to you.
Once again, I thank you for your help.
Regards,
doglover
doglover said:Geoff:
1.)
The code behind the After_Update event on ChooseCust combo box:
Private Sub ChooseCust_AfterUpdate()
On Error Resume Next
Me!ChooseJob = Null
Me!ChooseJob.Requery
End Sub
The code behind the After_update event on the ChooseJob combo box:
Private Sub ChooseJob_AfterUpdate()
On Error Resume Next
Me.FilterOn = False
Me.Requery
End Sub
frmInvoiceSelect allows filters and has the following code:
Private Sub Form_Open(Cancel As Integer)
Me.Filter = "[wrkid]=0"
Me.FilterOn = True
End Sub
Tell me exactly where you want the code placed in the ChooseJob combo box
and the ChooseCust combo box.
I just want to make sure that I am following your instructions correctly.
2.) Could the code be missing that tells the expressions placed in form
frmInvoiceSelect and and the associated queries be missing. I assumed that
an access built in function directs the expressions to fire. I was wondering
if perhaps a built-in function could be missing or a predefined property?
Just a thought.
I am attempting to look for missing modules in the Access 97 version will
advise in a seperate post.
I am a Florida native and unfortunately I do not speak French. I am
curious, why French?
Regards,
doglover
Geoff said:Correction (apologies):
Clearly, you should have a function in a standard module called
"zfSortLabel".
In a standard module, the function should appear something like this:
Public Function zfSortLabel(Argument1, Argument2)
... Code here...
End Function
Therefore, I should have advised you to search for "zfSortLabel" (not "=zf")
in the VBA editor.
Notice, there is no leading equals sign (=) when you search for
"zfSortLabel". This is because there is no leading equals sign in the
function's definition (see above - "Public Function zfSortLabel"). As you
know, you're trying to find the function to establish its existence or
absence.
In contrast, the leading equals sign is used in the OnClick event property
of the 5 labels in the form header ("btnktkno", "btntktfl_invoice", etc).
This is because the equals sign tells Access to call a function when the
OnClick event is fired. Therefore, the OnClick event property calls the
function as "=zfSortLabel(arg1, arg2). Obviously, the function does
something using the arguments that are passed to it. As you indicate, it
probably sorts something on the form. It may sort something different
depending on which label is clicked - which may send different arguments to
the function.
Sorry if this is all obvious to you - I'm just correcting an earlier
mistake.
Geoff.