Parameter Value??

G

Guest

Hi,

I have an unbound form that I am using for a switchboard with a combo box
"Combo32". There is another combo box "Combo8" that holds tech names. I have
a list box that will populate jobs based on tech name in Combo8. To keep
users on direct path, I have entered code for list box to open reminder form
that they still have time open on another job before proceeding to job
clicked. Combo32 will allow user to type in job number, should they have
reason to go there, when job number is not listed in box for their name. I
failed to include this code for Combo32 and they can just enter any job
number and proceed with time without ending time on job already open.

I've put the following code for Combo32, but when I enter job number and
click it displays message box "Enter Parameter Value" CboTech with box for
entry.

Private Sub Combo32_AfterUpdate()
Dim strFilter As String

strFilter = "JobNumber=" & Me.Combo32
Me.PumpType = DLookup("PumpType", "tGeneralInfo", strFilter)
If IsNull(Forms!fWorkLogHiddenOpen!StopTime) Then
DoCmd.OpenForm "fWorkLogReminder", , , "[CboTech]='" &
Forms!fSwitchboard!Combo8 & "'"
Else
DoCmd.OpenForm "fGeneralInfo", , , strFilter
End If
End Sub

If anyone has any suggestions as to why this is still asking for tech name,
I would sure appreciate it. Just when ya think you have some small part of
coding figured out to work - it doesn't!!!! And as usual, it will probably
be something simple!!!

Thanks in advance,
Pam
 
D

Douglas J. Steele

When you specify a Where condition (like "[CboTech]='" &
Forms!fSwitchboard!Combo8 & "'"), you're referring to fields in the
underlying recordset of the form. Is CboTech the name of a field in the
recordsource for the form? Access seems to think it isn't.
 
G

Guest

Doug,

Thank you for the prompt reply. CboTech is the name of the combo box that
references the field Tech. I removed "Cbo" and it works properly providing
there is open time on a job and then the reminder form opens. If the user is
not already logged onto a job, it shows error 2501 Open Form Action was
cancelled. Is there a reason this is happening or should I just put error
handling code for this specific error?
Thanks again for bringing the "name" error to my attention.
Pam

Douglas J. Steele said:
When you specify a Where condition (like "[CboTech]='" &
Forms!fSwitchboard!Combo8 & "'"), you're referring to fields in the
underlying recordset of the form. Is CboTech the name of a field in the
recordsource for the form? Access seems to think it isn't.


--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


PHisaw said:
Hi,

I have an unbound form that I am using for a switchboard with a combo box
"Combo32". There is another combo box "Combo8" that holds tech names. I
have
a list box that will populate jobs based on tech name in Combo8. To keep
users on direct path, I have entered code for list box to open reminder
form
that they still have time open on another job before proceeding to job
clicked. Combo32 will allow user to type in job number, should they have
reason to go there, when job number is not listed in box for their name.
I
failed to include this code for Combo32 and they can just enter any job
number and proceed with time without ending time on job already open.

I've put the following code for Combo32, but when I enter job number and
click it displays message box "Enter Parameter Value" CboTech with box for
entry.

Private Sub Combo32_AfterUpdate()
Dim strFilter As String

strFilter = "JobNumber=" & Me.Combo32
Me.PumpType = DLookup("PumpType", "tGeneralInfo", strFilter)
If IsNull(Forms!fWorkLogHiddenOpen!StopTime) Then
DoCmd.OpenForm "fWorkLogReminder", , , "[CboTech]='" &
Forms!fSwitchboard!Combo8 & "'"
Else
DoCmd.OpenForm "fGeneralInfo", , , strFilter
End If
End Sub

If anyone has any suggestions as to why this is still asking for tech
name,
I would sure appreciate it. Just when ya think you have some small part
of
coding figured out to work - it doesn't!!!! And as usual, it will
probably
be something simple!!!

Thanks in advance,
Pam
 
D

Douglas J. Steele

Sorry, I don't know what you mean by "if the user is not already logged onto
a job", nor how that relates to what your form is doing.

Does it mean that one (or more) of the forms you're expecting to be open
might not be open?

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


PHisaw said:
Doug,

Thank you for the prompt reply. CboTech is the name of the combo box that
references the field Tech. I removed "Cbo" and it works properly
providing
there is open time on a job and then the reminder form opens. If the user
is
not already logged onto a job, it shows error 2501 Open Form Action was
cancelled. Is there a reason this is happening or should I just put error
handling code for this specific error?
Thanks again for bringing the "name" error to my attention.
Pam

Douglas J. Steele said:
When you specify a Where condition (like "[CboTech]='" &
Forms!fSwitchboard!Combo8 & "'"), you're referring to fields in the
underlying recordset of the form. Is CboTech the name of a field in the
recordsource for the form? Access seems to think it isn't.


--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


PHisaw said:
Hi,

I have an unbound form that I am using for a switchboard with a combo
box
"Combo32". There is another combo box "Combo8" that holds tech names.
I
have
a list box that will populate jobs based on tech name in Combo8. To
keep
users on direct path, I have entered code for list box to open reminder
form
that they still have time open on another job before proceeding to job
clicked. Combo32 will allow user to type in job number, should they
have
reason to go there, when job number is not listed in box for their
name.
I
failed to include this code for Combo32 and they can just enter any job
number and proceed with time without ending time on job already open.

I've put the following code for Combo32, but when I enter job number
and
click it displays message box "Enter Parameter Value" CboTech with box
for
entry.

Private Sub Combo32_AfterUpdate()
Dim strFilter As String

strFilter = "JobNumber=" & Me.Combo32
Me.PumpType = DLookup("PumpType", "tGeneralInfo", strFilter)
If IsNull(Forms!fWorkLogHiddenOpen!StopTime) Then
DoCmd.OpenForm "fWorkLogReminder", , , "[CboTech]='" &
Forms!fSwitchboard!Combo8 & "'"
Else
DoCmd.OpenForm "fGeneralInfo", , , strFilter
End If
End Sub

If anyone has any suggestions as to why this is still asking for tech
name,
I would sure appreciate it. Just when ya think you have some small
part
of
coding figured out to work - it doesn't!!!! And as usual, it will
probably
be something simple!!!

Thanks in advance,
Pam
 
G

Guest

I'm sorry- I'll try to explain better. I have a hidden form
fWorkLogHiddenOpen that checks for nulls in StopTime and if empty,
fWorkLogReminder opens when user clicks into a job so that user can enter
StopTime value and end open job. The error occurs when there is not a job
with open StopTime. User enters job number into Combo32 and error Open Form
Action cancelled. When I debug, this line of code is highlighted:

DoCmd.OpenForm "fWorkLogReminder", , , "[Tech]='" &
Forms!fSwitchboard!Combo8 & "'"

It's supposed to be if there are no jobs open, go directly to the Else
statement (open form "fGeneralInfo").

I hope this explains better and you can shed some light on how to correct it.
Thanks,
Pam

Douglas J. Steele said:
Sorry, I don't know what you mean by "if the user is not already logged onto
a job", nor how that relates to what your form is doing.

Does it mean that one (or more) of the forms you're expecting to be open
might not be open?

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


PHisaw said:
Doug,

Thank you for the prompt reply. CboTech is the name of the combo box that
references the field Tech. I removed "Cbo" and it works properly
providing
there is open time on a job and then the reminder form opens. If the user
is
not already logged onto a job, it shows error 2501 Open Form Action was
cancelled. Is there a reason this is happening or should I just put error
handling code for this specific error?
Thanks again for bringing the "name" error to my attention.
Pam

Douglas J. Steele said:
When you specify a Where condition (like "[CboTech]='" &
Forms!fSwitchboard!Combo8 & "'"), you're referring to fields in the
underlying recordset of the form. Is CboTech the name of a field in the
recordsource for the form? Access seems to think it isn't.


--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Hi,

I have an unbound form that I am using for a switchboard with a combo
box
"Combo32". There is another combo box "Combo8" that holds tech names.
I
have
a list box that will populate jobs based on tech name in Combo8. To
keep
users on direct path, I have entered code for list box to open reminder
form
that they still have time open on another job before proceeding to job
clicked. Combo32 will allow user to type in job number, should they
have
reason to go there, when job number is not listed in box for their
name.
I
failed to include this code for Combo32 and they can just enter any job
number and proceed with time without ending time on job already open.

I've put the following code for Combo32, but when I enter job number
and
click it displays message box "Enter Parameter Value" CboTech with box
for
entry.

Private Sub Combo32_AfterUpdate()
Dim strFilter As String

strFilter = "JobNumber=" & Me.Combo32
Me.PumpType = DLookup("PumpType", "tGeneralInfo", strFilter)
If IsNull(Forms!fWorkLogHiddenOpen!StopTime) Then
DoCmd.OpenForm "fWorkLogReminder", , , "[CboTech]='" &
Forms!fSwitchboard!Combo8 & "'"
Else
DoCmd.OpenForm "fGeneralInfo", , , strFilter
End If
End Sub

If anyone has any suggestions as to why this is still asking for tech
name,
I would sure appreciate it. Just when ya think you have some small
part
of
coding figured out to work - it doesn't!!!! And as usual, it will
probably
be something simple!!!

Thanks in advance,
Pam
 
D

Douglas J. Steele

Is Tech a numeric field, or a text one?

Is the reference to Forms!fSwitchboard!Combo8 returning what it should be?



--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


PHisaw said:
I'm sorry- I'll try to explain better. I have a hidden form
fWorkLogHiddenOpen that checks for nulls in StopTime and if empty,
fWorkLogReminder opens when user clicks into a job so that user can enter
StopTime value and end open job. The error occurs when there is not a job
with open StopTime. User enters job number into Combo32 and error Open
Form
Action cancelled. When I debug, this line of code is highlighted:

DoCmd.OpenForm "fWorkLogReminder", , , "[Tech]='" &
Forms!fSwitchboard!Combo8 & "'"

It's supposed to be if there are no jobs open, go directly to the Else
statement (open form "fGeneralInfo").

I hope this explains better and you can shed some light on how to correct
it.
Thanks,
Pam

Douglas J. Steele said:
Sorry, I don't know what you mean by "if the user is not already logged
onto
a job", nor how that relates to what your form is doing.

Does it mean that one (or more) of the forms you're expecting to be open
might not be open?

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


PHisaw said:
Doug,

Thank you for the prompt reply. CboTech is the name of the combo box
that
references the field Tech. I removed "Cbo" and it works properly
providing
there is open time on a job and then the reminder form opens. If the
user
is
not already logged onto a job, it shows error 2501 Open Form Action was
cancelled. Is there a reason this is happening or should I just put
error
handling code for this specific error?
Thanks again for bringing the "name" error to my attention.
Pam

:

When you specify a Where condition (like "[CboTech]='" &
Forms!fSwitchboard!Combo8 & "'"), you're referring to fields in the
underlying recordset of the form. Is CboTech the name of a field in
the
recordsource for the form? Access seems to think it isn't.


--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Hi,

I have an unbound form that I am using for a switchboard with a
combo
box
"Combo32". There is another combo box "Combo8" that holds tech
names.
I
have
a list box that will populate jobs based on tech name in Combo8. To
keep
users on direct path, I have entered code for list box to open
reminder
form
that they still have time open on another job before proceeding to
job
clicked. Combo32 will allow user to type in job number, should they
have
reason to go there, when job number is not listed in box for their
name.
I
failed to include this code for Combo32 and they can just enter any
job
number and proceed with time without ending time on job already
open.

I've put the following code for Combo32, but when I enter job number
and
click it displays message box "Enter Parameter Value" CboTech with
box
for
entry.

Private Sub Combo32_AfterUpdate()
Dim strFilter As String

strFilter = "JobNumber=" & Me.Combo32
Me.PumpType = DLookup("PumpType", "tGeneralInfo", strFilter)
If IsNull(Forms!fWorkLogHiddenOpen!StopTime) Then
DoCmd.OpenForm "fWorkLogReminder", , , "[CboTech]='" &
Forms!fSwitchboard!Combo8 & "'"
Else
DoCmd.OpenForm "fGeneralInfo", , , strFilter
End If
End Sub

If anyone has any suggestions as to why this is still asking for
tech
name,
I would sure appreciate it. Just when ya think you have some small
part
of
coding figured out to work - it doesn't!!!! And as usual, it will
probably
be something simple!!!

Thanks in advance,
Pam
 
G

Guest

Tech is a text field. The reference to Combo8 is returning what it is
supposed to - opening fWorkLogReminder - only if there is a job with StopTime
field empty. If not, the error message appears.

Pam

Douglas J. Steele said:
Is Tech a numeric field, or a text one?

Is the reference to Forms!fSwitchboard!Combo8 returning what it should be?



--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


PHisaw said:
I'm sorry- I'll try to explain better. I have a hidden form
fWorkLogHiddenOpen that checks for nulls in StopTime and if empty,
fWorkLogReminder opens when user clicks into a job so that user can enter
StopTime value and end open job. The error occurs when there is not a job
with open StopTime. User enters job number into Combo32 and error Open
Form
Action cancelled. When I debug, this line of code is highlighted:

DoCmd.OpenForm "fWorkLogReminder", , , "[Tech]='" &
Forms!fSwitchboard!Combo8 & "'"

It's supposed to be if there are no jobs open, go directly to the Else
statement (open form "fGeneralInfo").

I hope this explains better and you can shed some light on how to correct
it.
Thanks,
Pam

Douglas J. Steele said:
Sorry, I don't know what you mean by "if the user is not already logged
onto
a job", nor how that relates to what your form is doing.

Does it mean that one (or more) of the forms you're expecting to be open
might not be open?

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Doug,

Thank you for the prompt reply. CboTech is the name of the combo box
that
references the field Tech. I removed "Cbo" and it works properly
providing
there is open time on a job and then the reminder form opens. If the
user
is
not already logged onto a job, it shows error 2501 Open Form Action was
cancelled. Is there a reason this is happening or should I just put
error
handling code for this specific error?
Thanks again for bringing the "name" error to my attention.
Pam

:

When you specify a Where condition (like "[CboTech]='" &
Forms!fSwitchboard!Combo8 & "'"), you're referring to fields in the
underlying recordset of the form. Is CboTech the name of a field in
the
recordsource for the form? Access seems to think it isn't.


--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Hi,

I have an unbound form that I am using for a switchboard with a
combo
box
"Combo32". There is another combo box "Combo8" that holds tech
names.
I
have
a list box that will populate jobs based on tech name in Combo8. To
keep
users on direct path, I have entered code for list box to open
reminder
form
that they still have time open on another job before proceeding to
job
clicked. Combo32 will allow user to type in job number, should they
have
reason to go there, when job number is not listed in box for their
name.
I
failed to include this code for Combo32 and they can just enter any
job
number and proceed with time without ending time on job already
open.

I've put the following code for Combo32, but when I enter job number
and
click it displays message box "Enter Parameter Value" CboTech with
box
for
entry.

Private Sub Combo32_AfterUpdate()
Dim strFilter As String

strFilter = "JobNumber=" & Me.Combo32
Me.PumpType = DLookup("PumpType", "tGeneralInfo", strFilter)
If IsNull(Forms!fWorkLogHiddenOpen!StopTime) Then
DoCmd.OpenForm "fWorkLogReminder", , , "[CboTech]='" &
Forms!fSwitchboard!Combo8 & "'"
Else
DoCmd.OpenForm "fGeneralInfo", , , strFilter
End If
End Sub

If anyone has any suggestions as to why this is still asking for
tech
name,
I would sure appreciate it. Just when ya think you have some small
part
of
coding figured out to work - it doesn't!!!! And as usual, it will
probably
be something simple!!!

Thanks in advance,
Pam
 
D

Douglas J. Steele

So if you were to put

MsgBox Forms!fSwitchboard!Combo8

in your code, it's going to return a name, and not, say, a number of the
selected row?

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


PHisaw said:
Tech is a text field. The reference to Combo8 is returning what it is
supposed to - opening fWorkLogReminder - only if there is a job with
StopTime
field empty. If not, the error message appears.

Pam

Douglas J. Steele said:
Is Tech a numeric field, or a text one?

Is the reference to Forms!fSwitchboard!Combo8 returning what it should
be?



--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


PHisaw said:
I'm sorry- I'll try to explain better. I have a hidden form
fWorkLogHiddenOpen that checks for nulls in StopTime and if empty,
fWorkLogReminder opens when user clicks into a job so that user can
enter
StopTime value and end open job. The error occurs when there is not a
job
with open StopTime. User enters job number into Combo32 and error Open
Form
Action cancelled. When I debug, this line of code is highlighted:

DoCmd.OpenForm "fWorkLogReminder", , , "[Tech]='" &
Forms!fSwitchboard!Combo8 & "'"

It's supposed to be if there are no jobs open, go directly to the Else
statement (open form "fGeneralInfo").

I hope this explains better and you can shed some light on how to
correct
it.
Thanks,
Pam

:

Sorry, I don't know what you mean by "if the user is not already
logged
onto
a job", nor how that relates to what your form is doing.

Does it mean that one (or more) of the forms you're expecting to be
open
might not be open?

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Doug,

Thank you for the prompt reply. CboTech is the name of the combo
box
that
references the field Tech. I removed "Cbo" and it works properly
providing
there is open time on a job and then the reminder form opens. If
the
user
is
not already logged onto a job, it shows error 2501 Open Form Action
was
cancelled. Is there a reason this is happening or should I just put
error
handling code for this specific error?
Thanks again for bringing the "name" error to my attention.
Pam

:

When you specify a Where condition (like "[CboTech]='" &
Forms!fSwitchboard!Combo8 & "'"), you're referring to fields in the
underlying recordset of the form. Is CboTech the name of a field in
the
recordsource for the form? Access seems to think it isn't.


--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Hi,

I have an unbound form that I am using for a switchboard with a
combo
box
"Combo32". There is another combo box "Combo8" that holds tech
names.
I
have
a list box that will populate jobs based on tech name in Combo8.
To
keep
users on direct path, I have entered code for list box to open
reminder
form
that they still have time open on another job before proceeding
to
job
clicked. Combo32 will allow user to type in job number, should
they
have
reason to go there, when job number is not listed in box for
their
name.
I
failed to include this code for Combo32 and they can just enter
any
job
number and proceed with time without ending time on job already
open.

I've put the following code for Combo32, but when I enter job
number
and
click it displays message box "Enter Parameter Value" CboTech
with
box
for
entry.

Private Sub Combo32_AfterUpdate()
Dim strFilter As String

strFilter = "JobNumber=" & Me.Combo32
Me.PumpType = DLookup("PumpType", "tGeneralInfo", strFilter)
If IsNull(Forms!fWorkLogHiddenOpen!StopTime) Then
DoCmd.OpenForm "fWorkLogReminder", , , "[CboTech]='" &
Forms!fSwitchboard!Combo8 & "'"
Else
DoCmd.OpenForm "fGeneralInfo", , , strFilter
End If
End Sub

If anyone has any suggestions as to why this is still asking for
tech
name,
I would sure appreciate it. Just when ya think you have some
small
part
of
coding figured out to work - it doesn't!!!! And as usual, it
will
probably
be something simple!!!

Thanks in advance,
Pam
 
G

Guest

Doug,

I've been away from work and can now try your suggestion. If I enter MsgBox
Forms!fSwitchboard!Combo8 in the AfterUpdate event, when I enter a job number
it returns the tech name that is in Combo8. I don't want to use an error
handler for this error message if something else is causing a problem. I'd
like to find problem instead of just a "fix" solution.

Thanks again for your help,
Pam

Douglas J. Steele said:
So if you were to put

MsgBox Forms!fSwitchboard!Combo8

in your code, it's going to return a name, and not, say, a number of the
selected row?

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


PHisaw said:
Tech is a text field. The reference to Combo8 is returning what it is
supposed to - opening fWorkLogReminder - only if there is a job with
StopTime
field empty. If not, the error message appears.

Pam

Douglas J. Steele said:
Is Tech a numeric field, or a text one?

Is the reference to Forms!fSwitchboard!Combo8 returning what it should
be?



--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


I'm sorry- I'll try to explain better. I have a hidden form
fWorkLogHiddenOpen that checks for nulls in StopTime and if empty,
fWorkLogReminder opens when user clicks into a job so that user can
enter
StopTime value and end open job. The error occurs when there is not a
job
with open StopTime. User enters job number into Combo32 and error Open
Form
Action cancelled. When I debug, this line of code is highlighted:

DoCmd.OpenForm "fWorkLogReminder", , , "[Tech]='" &
Forms!fSwitchboard!Combo8 & "'"

It's supposed to be if there are no jobs open, go directly to the Else
statement (open form "fGeneralInfo").

I hope this explains better and you can shed some light on how to
correct
it.
Thanks,
Pam

:

Sorry, I don't know what you mean by "if the user is not already
logged
onto
a job", nor how that relates to what your form is doing.

Does it mean that one (or more) of the forms you're expecting to be
open
might not be open?

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Doug,

Thank you for the prompt reply. CboTech is the name of the combo
box
that
references the field Tech. I removed "Cbo" and it works properly
providing
there is open time on a job and then the reminder form opens. If
the
user
is
not already logged onto a job, it shows error 2501 Open Form Action
was
cancelled. Is there a reason this is happening or should I just put
error
handling code for this specific error?
Thanks again for bringing the "name" error to my attention.
Pam

:

When you specify a Where condition (like "[CboTech]='" &
Forms!fSwitchboard!Combo8 & "'"), you're referring to fields in the
underlying recordset of the form. Is CboTech the name of a field in
the
recordsource for the form? Access seems to think it isn't.


--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Hi,

I have an unbound form that I am using for a switchboard with a
combo
box
"Combo32". There is another combo box "Combo8" that holds tech
names.
I
have
a list box that will populate jobs based on tech name in Combo8.
To
keep
users on direct path, I have entered code for list box to open
reminder
form
that they still have time open on another job before proceeding
to
job
clicked. Combo32 will allow user to type in job number, should
they
have
reason to go there, when job number is not listed in box for
their
name.
I
failed to include this code for Combo32 and they can just enter
any
job
number and proceed with time without ending time on job already
open.

I've put the following code for Combo32, but when I enter job
number
and
click it displays message box "Enter Parameter Value" CboTech
with
box
for
entry.

Private Sub Combo32_AfterUpdate()
Dim strFilter As String

strFilter = "JobNumber=" & Me.Combo32
Me.PumpType = DLookup("PumpType", "tGeneralInfo", strFilter)
If IsNull(Forms!fWorkLogHiddenOpen!StopTime) Then
DoCmd.OpenForm "fWorkLogReminder", , , "[CboTech]='" &
Forms!fSwitchboard!Combo8 & "'"
Else
DoCmd.OpenForm "fGeneralInfo", , , strFilter
End If
End Sub

If anyone has any suggestions as to why this is still asking for
tech
name,
I would sure appreciate it. Just when ya think you have some
small
part
of
coding figured out to work - it doesn't!!!! And as usual, it
will
probably
be something simple!!!

Thanks in advance,
Pam
 
D

Douglas J. Steele

If it's returning a name, I'm afraid I have no idea why the code isn't
working.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


PHisaw said:
Doug,

I've been away from work and can now try your suggestion. If I enter
MsgBox
Forms!fSwitchboard!Combo8 in the AfterUpdate event, when I enter a job
number
it returns the tech name that is in Combo8. I don't want to use an error
handler for this error message if something else is causing a problem.
I'd
like to find problem instead of just a "fix" solution.

Thanks again for your help,
Pam

Douglas J. Steele said:
So if you were to put

MsgBox Forms!fSwitchboard!Combo8

in your code, it's going to return a name, and not, say, a number of the
selected row?

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


PHisaw said:
Tech is a text field. The reference to Combo8 is returning what it is
supposed to - opening fWorkLogReminder - only if there is a job with
StopTime
field empty. If not, the error message appears.

Pam

:

Is Tech a numeric field, or a text one?

Is the reference to Forms!fSwitchboard!Combo8 returning what it should
be?



--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


I'm sorry- I'll try to explain better. I have a hidden form
fWorkLogHiddenOpen that checks for nulls in StopTime and if empty,
fWorkLogReminder opens when user clicks into a job so that user can
enter
StopTime value and end open job. The error occurs when there is not
a
job
with open StopTime. User enters job number into Combo32 and error
Open
Form
Action cancelled. When I debug, this line of code is highlighted:

DoCmd.OpenForm "fWorkLogReminder", , , "[Tech]='" &
Forms!fSwitchboard!Combo8 & "'"

It's supposed to be if there are no jobs open, go directly to the
Else
statement (open form "fGeneralInfo").

I hope this explains better and you can shed some light on how to
correct
it.
Thanks,
Pam

:

Sorry, I don't know what you mean by "if the user is not already
logged
onto
a job", nor how that relates to what your form is doing.

Does it mean that one (or more) of the forms you're expecting to be
open
might not be open?

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Doug,

Thank you for the prompt reply. CboTech is the name of the combo
box
that
references the field Tech. I removed "Cbo" and it works properly
providing
there is open time on a job and then the reminder form opens. If
the
user
is
not already logged onto a job, it shows error 2501 Open Form
Action
was
cancelled. Is there a reason this is happening or should I just
put
error
handling code for this specific error?
Thanks again for bringing the "name" error to my attention.
Pam

:

When you specify a Where condition (like "[CboTech]='" &
Forms!fSwitchboard!Combo8 & "'"), you're referring to fields in
the
underlying recordset of the form. Is CboTech the name of a field
in
the
recordsource for the form? Access seems to think it isn't.


--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Hi,

I have an unbound form that I am using for a switchboard with
a
combo
box
"Combo32". There is another combo box "Combo8" that holds tech
names.
I
have
a list box that will populate jobs based on tech name in
Combo8.
To
keep
users on direct path, I have entered code for list box to open
reminder
form
that they still have time open on another job before
proceeding
to
job
clicked. Combo32 will allow user to type in job number,
should
they
have
reason to go there, when job number is not listed in box for
their
name.
I
failed to include this code for Combo32 and they can just
enter
any
job
number and proceed with time without ending time on job
already
open.

I've put the following code for Combo32, but when I enter job
number
and
click it displays message box "Enter Parameter Value" CboTech
with
box
for
entry.

Private Sub Combo32_AfterUpdate()
Dim strFilter As String

strFilter = "JobNumber=" & Me.Combo32
Me.PumpType = DLookup("PumpType", "tGeneralInfo", strFilter)
If IsNull(Forms!fWorkLogHiddenOpen!StopTime) Then
DoCmd.OpenForm "fWorkLogReminder", , , "[CboTech]='" &
Forms!fSwitchboard!Combo8 & "'"
Else
DoCmd.OpenForm "fGeneralInfo", , , strFilter
End If
End Sub

If anyone has any suggestions as to why this is still asking
for
tech
name,
I would sure appreciate it. Just when ya think you have some
small
part
of
coding figured out to work - it doesn't!!!! And as usual, it
will
probably
be something simple!!!

Thanks in advance,
Pam
 
G

Guest

Doug,

I put an error handler code in and it stopped showing the error message, so
I'll leave well enough alone. Just one of those people that likes to know
the how and why, not just a fix.

Thanks for working with me on this. As always, much appreciated!!
Pam

Douglas J. Steele said:
If it's returning a name, I'm afraid I have no idea why the code isn't
working.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


PHisaw said:
Doug,

I've been away from work and can now try your suggestion. If I enter
MsgBox
Forms!fSwitchboard!Combo8 in the AfterUpdate event, when I enter a job
number
it returns the tech name that is in Combo8. I don't want to use an error
handler for this error message if something else is causing a problem.
I'd
like to find problem instead of just a "fix" solution.

Thanks again for your help,
Pam

Douglas J. Steele said:
So if you were to put

MsgBox Forms!fSwitchboard!Combo8

in your code, it's going to return a name, and not, say, a number of the
selected row?

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Tech is a text field. The reference to Combo8 is returning what it is
supposed to - opening fWorkLogReminder - only if there is a job with
StopTime
field empty. If not, the error message appears.

Pam

:

Is Tech a numeric field, or a text one?

Is the reference to Forms!fSwitchboard!Combo8 returning what it should
be?



--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


I'm sorry- I'll try to explain better. I have a hidden form
fWorkLogHiddenOpen that checks for nulls in StopTime and if empty,
fWorkLogReminder opens when user clicks into a job so that user can
enter
StopTime value and end open job. The error occurs when there is not
a
job
with open StopTime. User enters job number into Combo32 and error
Open
Form
Action cancelled. When I debug, this line of code is highlighted:

DoCmd.OpenForm "fWorkLogReminder", , , "[Tech]='" &
Forms!fSwitchboard!Combo8 & "'"

It's supposed to be if there are no jobs open, go directly to the
Else
statement (open form "fGeneralInfo").

I hope this explains better and you can shed some light on how to
correct
it.
Thanks,
Pam

:

Sorry, I don't know what you mean by "if the user is not already
logged
onto
a job", nor how that relates to what your form is doing.

Does it mean that one (or more) of the forms you're expecting to be
open
might not be open?

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Doug,

Thank you for the prompt reply. CboTech is the name of the combo
box
that
references the field Tech. I removed "Cbo" and it works properly
providing
there is open time on a job and then the reminder form opens. If
the
user
is
not already logged onto a job, it shows error 2501 Open Form
Action
was
cancelled. Is there a reason this is happening or should I just
put
error
handling code for this specific error?
Thanks again for bringing the "name" error to my attention.
Pam

:

When you specify a Where condition (like "[CboTech]='" &
Forms!fSwitchboard!Combo8 & "'"), you're referring to fields in
the
underlying recordset of the form. Is CboTech the name of a field
in
the
recordsource for the form? Access seems to think it isn't.


--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Hi,

I have an unbound form that I am using for a switchboard with
a
combo
box
"Combo32". There is another combo box "Combo8" that holds tech
names.
I
have
a list box that will populate jobs based on tech name in
Combo8.
To
keep
users on direct path, I have entered code for list box to open
reminder
form
that they still have time open on another job before
proceeding
to
job
clicked. Combo32 will allow user to type in job number,
should
they
have
reason to go there, when job number is not listed in box for
their
name.
I
failed to include this code for Combo32 and they can just
enter
any
job
number and proceed with time without ending time on job
already
open.

I've put the following code for Combo32, but when I enter job
number
and
click it displays message box "Enter Parameter Value" CboTech
with
box
for
entry.

Private Sub Combo32_AfterUpdate()
Dim strFilter As String

strFilter = "JobNumber=" & Me.Combo32
Me.PumpType = DLookup("PumpType", "tGeneralInfo", strFilter)
If IsNull(Forms!fWorkLogHiddenOpen!StopTime) Then
DoCmd.OpenForm "fWorkLogReminder", , , "[CboTech]='" &
Forms!fSwitchboard!Combo8 & "'"
Else
DoCmd.OpenForm "fGeneralInfo", , , strFilter
End If
End Sub

If anyone has any suggestions as to why this is still asking
for
tech
name,
I would sure appreciate it. Just when ya think you have some
small
part
of
coding figured out to work - it doesn't!!!! And as usual, it
will
probably
be something simple!!!

Thanks in advance,
Pam
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top