Form with linked criteria - way to have not linked if null?

G

Guest

I have a main form that records attendance with a drop down of dates
available. When I go thru and enter all the regular attendees, i have a
button that will open up a form with available presenters for me to enter as
attending that day (as a presenter). It consists of a drop down that shows
all the company names of the possible companies in my table (that are not
null) and when you choose a presenter, it displays their contact info below
with an option to choose how many will be in attendance for that company. I
then click a button that runs an append qry to add them to attendance.

My problem is that I can only get it to work one of two ways - either i have
a button that opens the presenter form with no linked criteria (all records)
but then it won't show me who is currently set to attend for that date
already. OR i have a button that has a linked criteria on the date on the
main form and a matching date in one of the fields of the table that the
presenters form has. Only problem with this is that if there are no companies
set to present for that date, it won't allow me to choose any more either -
it will display the companies in the drop down but when i click on one, no
information shows up below in their contact info because there record source
is null.

Is there any ways to add some sort of defining criteria that if there are
currently no records associated with this date, dont link the criteria - show
all records. If there is a record(s) for the associated date, pull that date
and allow me to add more if i choose.....


Thanks!
 
G

Graham Mandeno

Hi Heidi

Use a string variable to set up your WhereCondition argument for the
OpenForm (if you used the wizard for your button code, you will have one
already called stLinkCriteria).

Now, check first to see if the combo box is null before setting the value in
the string:

If Not IsNull(cboCompany) Then
stLinkCriteria = "CompanyID=" & cboCompany
' the Else stLinkCriteria = "" is implied
End If
DoCmd.OpenForm ...
 
G

Guest

Graham,

Sorry it took so long to try this but things have been a little
nuts....Quick question on this - w/the first part where you check if
cbocompnay is not null.... I want to check if the date is null though don't
I? If there is no date that matches in the field in the company form, then
don't pull anything specific, otherwise, only pull the company that has a
date that matches the main form...

Thanks,
Heidi

Graham Mandeno said:
Hi Heidi

Use a string variable to set up your WhereCondition argument for the
OpenForm (if you used the wizard for your button code, you will have one
already called stLinkCriteria).

Now, check first to see if the combo box is null before setting the value in
the string:

If Not IsNull(cboCompany) Then
stLinkCriteria = "CompanyID=" & cboCompany
' the Else stLinkCriteria = "" is implied
End If
DoCmd.OpenForm ...

--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand

Heidi said:
I have a main form that records attendance with a drop down of dates
available. When I go thru and enter all the regular attendees, i have a
button that will open up a form with available presenters for me to enter
as
attending that day (as a presenter). It consists of a drop down that shows
all the company names of the possible companies in my table (that are not
null) and when you choose a presenter, it displays their contact info
below
with an option to choose how many will be in attendance for that company.
I
then click a button that runs an append qry to add them to attendance.

My problem is that I can only get it to work one of two ways - either i
have
a button that opens the presenter form with no linked criteria (all
records)
but then it won't show me who is currently set to attend for that date
already. OR i have a button that has a linked criteria on the date on the
main form and a matching date in one of the fields of the table that the
presenters form has. Only problem with this is that if there are no
companies
set to present for that date, it won't allow me to choose any more
either -
it will display the companies in the drop down but when i click on one, no
information shows up below in their contact info because there record
source
is null.

Is there any ways to add some sort of defining criteria that if there are
currently no records associated with this date, dont link the criteria -
show
all records. If there is a record(s) for the associated date, pull that
date
and allow me to add more if i choose.....


Thanks!
 
G

Graham Mandeno

Hi Heidi

Sorry - I read your post too quickly and thought you were selecting on the
Company combo.

Perhaps it would help if you posted the code you are currently using to open
the form.
--
Graham Mandeno [Access MVP]
Auckland, New Zealand

Heidi said:
Graham,

Sorry it took so long to try this but things have been a little
nuts....Quick question on this - w/the first part where you check if
cbocompnay is not null.... I want to check if the date is null though
don't
I? If there is no date that matches in the field in the company form, then
don't pull anything specific, otherwise, only pull the company that has a
date that matches the main form...

Thanks,
Heidi

Graham Mandeno said:
Hi Heidi

Use a string variable to set up your WhereCondition argument for the
OpenForm (if you used the wizard for your button code, you will have one
already called stLinkCriteria).

Now, check first to see if the combo box is null before setting the value
in
the string:

If Not IsNull(cboCompany) Then
stLinkCriteria = "CompanyID=" & cboCompany
' the Else stLinkCriteria = "" is implied
End If
DoCmd.OpenForm ...

--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand

Heidi said:
I have a main form that records attendance with a drop down of dates
available. When I go thru and enter all the regular attendees, i have a
button that will open up a form with available presenters for me to
enter
as
attending that day (as a presenter). It consists of a drop down that
shows
all the company names of the possible companies in my table (that are
not
null) and when you choose a presenter, it displays their contact info
below
with an option to choose how many will be in attendance for that
company.
I
then click a button that runs an append qry to add them to attendance.

My problem is that I can only get it to work one of two ways - either i
have
a button that opens the presenter form with no linked criteria (all
records)
but then it won't show me who is currently set to attend for that date
already. OR i have a button that has a linked criteria on the date on
the
main form and a matching date in one of the fields of the table that
the
presenters form has. Only problem with this is that if there are no
companies
set to present for that date, it won't allow me to choose any more
either -
it will display the companies in the drop down but when i click on one,
no
information shows up below in their contact info because there record
source
is null.

Is there any ways to add some sort of defining criteria that if there
are
currently no records associated with this date, dont link the
criteria -
show
all records. If there is a record(s) for the associated date, pull that
date
and allow me to add more if i choose.....


Thanks!
 
G

Guest

Ok - i hope this is not too confusing......

Here is the code from just using a wizard to link the date on the main form
to the date (if there is any) in the source data in the company's form:
____________
Private Sub openEntAttendance_Click()
On Error GoTo Err_openEntAttendance_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "frmEntrepreneurAttendance"

stLinkCriteria = "[fkPresentDinnerID]=" & Me![Combo16]
DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_openEntAttendance_Click:
Exit Sub

Err_openEntAttendance_Click:
MsgBox Err.Description
Resume Exit_openEntAttendance_Click

End Sub
____________________________

So like i said, if there is no date in any record matching that date, it
pulls a null value and i can't do anything with it. The combo in the Company
form will hold names because it gets it's values straight from the table
rather than the source data as usual, but when it wont find any records to
match (because they're null) it does nothing. I can do a straight Open Form
with no linked criteria but then i can't tell which companies are slated for
that date - it shows them all. The user could then be adding the same company
multiple times at that rate, not realizing they're already added.

Thanks for your help - let me know!!
Heidi :)



Graham Mandeno said:
Hi Heidi

Sorry - I read your post too quickly and thought you were selecting on the
Company combo.

Perhaps it would help if you posted the code you are currently using to open
the form.
--
Graham Mandeno [Access MVP]
Auckland, New Zealand

Heidi said:
Graham,

Sorry it took so long to try this but things have been a little
nuts....Quick question on this - w/the first part where you check if
cbocompnay is not null.... I want to check if the date is null though
don't
I? If there is no date that matches in the field in the company form, then
don't pull anything specific, otherwise, only pull the company that has a
date that matches the main form...

Thanks,
Heidi

Graham Mandeno said:
Hi Heidi

Use a string variable to set up your WhereCondition argument for the
OpenForm (if you used the wizard for your button code, you will have one
already called stLinkCriteria).

Now, check first to see if the combo box is null before setting the value
in
the string:

If Not IsNull(cboCompany) Then
stLinkCriteria = "CompanyID=" & cboCompany
' the Else stLinkCriteria = "" is implied
End If
DoCmd.OpenForm ...

--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand

I have a main form that records attendance with a drop down of dates
available. When I go thru and enter all the regular attendees, i have a
button that will open up a form with available presenters for me to
enter
as
attending that day (as a presenter). It consists of a drop down that
shows
all the company names of the possible companies in my table (that are
not
null) and when you choose a presenter, it displays their contact info
below
with an option to choose how many will be in attendance for that
company.
I
then click a button that runs an append qry to add them to attendance.

My problem is that I can only get it to work one of two ways - either i
have
a button that opens the presenter form with no linked criteria (all
records)
but then it won't show me who is currently set to attend for that date
already. OR i have a button that has a linked criteria on the date on
the
main form and a matching date in one of the fields of the table that
the
presenters form has. Only problem with this is that if there are no
companies
set to present for that date, it won't allow me to choose any more
either -
it will display the companies in the drop down but when i click on one,
no
information shows up below in their contact info because there record
source
is null.

Is there any ways to add some sort of defining criteria that if there
are
currently no records associated with this date, dont link the
criteria -
show
all records. If there is a record(s) for the associated date, pull that
date
and allow me to add more if i choose.....


Thanks!
 
G

Graham Mandeno

Well, it looks like all you need is to check if Combo16 is null:

If Not IsNull(Combo16) Then
stLinkCriteria = "[fkPresentDinnerID]=" & Me![Combo16]
End If

BTW, you should rename Combo16 to something more meaningful - say,
cboSelectDate.
--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand

Heidi said:
Ok - i hope this is not too confusing......

Here is the code from just using a wizard to link the date on the main
form
to the date (if there is any) in the source data in the company's form:
____________
Private Sub openEntAttendance_Click()
On Error GoTo Err_openEntAttendance_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "frmEntrepreneurAttendance"

stLinkCriteria = "[fkPresentDinnerID]=" & Me![Combo16]
DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_openEntAttendance_Click:
Exit Sub

Err_openEntAttendance_Click:
MsgBox Err.Description
Resume Exit_openEntAttendance_Click

End Sub
____________________________

So like i said, if there is no date in any record matching that date, it
pulls a null value and i can't do anything with it. The combo in the
Company
form will hold names because it gets it's values straight from the table
rather than the source data as usual, but when it wont find any records to
match (because they're null) it does nothing. I can do a straight Open
Form
with no linked criteria but then i can't tell which companies are slated
for
that date - it shows them all. The user could then be adding the same
company
multiple times at that rate, not realizing they're already added.

Thanks for your help - let me know!!
Heidi :)



Graham Mandeno said:
Hi Heidi

Sorry - I read your post too quickly and thought you were selecting on
the
Company combo.

Perhaps it would help if you posted the code you are currently using to
open
the form.
--
Graham Mandeno [Access MVP]
Auckland, New Zealand

Heidi said:
Graham,

Sorry it took so long to try this but things have been a little
nuts....Quick question on this - w/the first part where you check if
cbocompnay is not null.... I want to check if the date is null though
don't
I? If there is no date that matches in the field in the company form,
then
don't pull anything specific, otherwise, only pull the company that has
a
date that matches the main form...

Thanks,
Heidi

:

Hi Heidi

Use a string variable to set up your WhereCondition argument for the
OpenForm (if you used the wizard for your button code, you will have
one
already called stLinkCriteria).

Now, check first to see if the combo box is null before setting the
value
in
the string:

If Not IsNull(cboCompany) Then
stLinkCriteria = "CompanyID=" & cboCompany
' the Else stLinkCriteria = "" is implied
End If
DoCmd.OpenForm ...

--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand

I have a main form that records attendance with a drop down of dates
available. When I go thru and enter all the regular attendees, i
have a
button that will open up a form with available presenters for me to
enter
as
attending that day (as a presenter). It consists of a drop down that
shows
all the company names of the possible companies in my table (that
are
not
null) and when you choose a presenter, it displays their contact
info
below
with an option to choose how many will be in attendance for that
company.
I
then click a button that runs an append qry to add them to
attendance.

My problem is that I can only get it to work one of two ways -
either i
have
a button that opens the presenter form with no linked criteria (all
records)
but then it won't show me who is currently set to attend for that
date
already. OR i have a button that has a linked criteria on the date
on
the
main form and a matching date in one of the fields of the table that
the
presenters form has. Only problem with this is that if there are no
companies
set to present for that date, it won't allow me to choose any more
either -
it will display the companies in the drop down but when i click on
one,
no
information shows up below in their contact info because there
record
source
is null.

Is there any ways to add some sort of defining criteria that if
there
are
currently no records associated with this date, dont link the
criteria -
show
all records. If there is a record(s) for the associated date, pull
that
date
and allow me to add more if i choose.....


Thanks!
 
G

Guest

Actually it's in the Company's form that I'm trying to check if null - that's
why it's so confusing... The combo will never be null, so that's not my
issue, it's if the combo has an id and when I open the
frmEntrepreneurAttendance form, that date field in the source code is either
null or matches the id in the combo. Does that make sense? I'm sorry if I'm
making this really confusing.... If there is no id/date that matches the
combo, it want it to show me all records in the frmEntrepreneurAttendance.



Graham Mandeno said:
Well, it looks like all you need is to check if Combo16 is null:

If Not IsNull(Combo16) Then
stLinkCriteria = "[fkPresentDinnerID]=" & Me![Combo16]
End If

BTW, you should rename Combo16 to something more meaningful - say,
cboSelectDate.
--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand

Heidi said:
Ok - i hope this is not too confusing......

Here is the code from just using a wizard to link the date on the main
form
to the date (if there is any) in the source data in the company's form:
____________
Private Sub openEntAttendance_Click()
On Error GoTo Err_openEntAttendance_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "frmEntrepreneurAttendance"

stLinkCriteria = "[fkPresentDinnerID]=" & Me![Combo16]
DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_openEntAttendance_Click:
Exit Sub

Err_openEntAttendance_Click:
MsgBox Err.Description
Resume Exit_openEntAttendance_Click

End Sub
____________________________

So like i said, if there is no date in any record matching that date, it
pulls a null value and i can't do anything with it. The combo in the
Company
form will hold names because it gets it's values straight from the table
rather than the source data as usual, but when it wont find any records to
match (because they're null) it does nothing. I can do a straight Open
Form
with no linked criteria but then i can't tell which companies are slated
for
that date - it shows them all. The user could then be adding the same
company
multiple times at that rate, not realizing they're already added.

Thanks for your help - let me know!!
Heidi :)



Graham Mandeno said:
Hi Heidi

Sorry - I read your post too quickly and thought you were selecting on
the
Company combo.

Perhaps it would help if you posted the code you are currently using to
open
the form.
--
Graham Mandeno [Access MVP]
Auckland, New Zealand

Graham,

Sorry it took so long to try this but things have been a little
nuts....Quick question on this - w/the first part where you check if
cbocompnay is not null.... I want to check if the date is null though
don't
I? If there is no date that matches in the field in the company form,
then
don't pull anything specific, otherwise, only pull the company that has
a
date that matches the main form...

Thanks,
Heidi

:

Hi Heidi

Use a string variable to set up your WhereCondition argument for the
OpenForm (if you used the wizard for your button code, you will have
one
already called stLinkCriteria).

Now, check first to see if the combo box is null before setting the
value
in
the string:

If Not IsNull(cboCompany) Then
stLinkCriteria = "CompanyID=" & cboCompany
' the Else stLinkCriteria = "" is implied
End If
DoCmd.OpenForm ...

--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand

I have a main form that records attendance with a drop down of dates
available. When I go thru and enter all the regular attendees, i
have a
button that will open up a form with available presenters for me to
enter
as
attending that day (as a presenter). It consists of a drop down that
shows
all the company names of the possible companies in my table (that
are
not
null) and when you choose a presenter, it displays their contact
info
below
with an option to choose how many will be in attendance for that
company.
I
then click a button that runs an append qry to add them to
attendance.

My problem is that I can only get it to work one of two ways -
either i
have
a button that opens the presenter form with no linked criteria (all
records)
but then it won't show me who is currently set to attend for that
date
already. OR i have a button that has a linked criteria on the date
on
the
main form and a matching date in one of the fields of the table that
the
presenters form has. Only problem with this is that if there are no
companies
set to present for that date, it won't allow me to choose any more
either -
it will display the companies in the drop down but when i click on
one,
no
information shows up below in their contact info because there
record
source
is null.

Is there any ways to add some sort of defining criteria that if
there
are
currently no records associated with this date, dont link the
criteria -
show
all records. If there is a record(s) for the associated date, pull
that
date
and allow me to add more if i choose.....


Thanks!
 
G

Graham Mandeno

Then you should use the expression:

If Not IsNull([control that contains the company ID]) Then
stLinkCriteria = ...


--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand

Heidi said:
Actually it's in the Company's form that I'm trying to check if null -
that's
why it's so confusing... The combo will never be null, so that's not my
issue, it's if the combo has an id and when I open the
frmEntrepreneurAttendance form, that date field in the source code is
either
null or matches the id in the combo. Does that make sense? I'm sorry if
I'm
making this really confusing.... If there is no id/date that matches the
combo, it want it to show me all records in the frmEntrepreneurAttendance.



Graham Mandeno said:
Well, it looks like all you need is to check if Combo16 is null:

If Not IsNull(Combo16) Then
stLinkCriteria = "[fkPresentDinnerID]=" & Me![Combo16]
End If

BTW, you should rename Combo16 to something more meaningful - say,
cboSelectDate.
--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand
 
G

Guest

I have tried that before but I get an error message (tried it again to be
sure):
"Microsoft Office Access can't find the field "|" referred to in your
expression"

Do I need some sort of syntax to designate that the control is located in
the other form? I don't know the syntax for that so I havne't been able to
test it... this is what i have in my code with what you suggested:

stDocName = "frmEntrepreneurAttendance"

If Not IsNull([EntrepreneurID]) Then
stLinkCriteria = "[fkPresentDinnerID]=" & Me![cmbfkDinnerID]
End If

DoCmd.OpenForm stDocName, , , stLinkCriteria


Thanks! :)

Graham Mandeno said:
Then you should use the expression:

If Not IsNull([control that contains the company ID]) Then
stLinkCriteria = ...


--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand

Heidi said:
Actually it's in the Company's form that I'm trying to check if null -
that's
why it's so confusing... The combo will never be null, so that's not my
issue, it's if the combo has an id and when I open the
frmEntrepreneurAttendance form, that date field in the source code is
either
null or matches the id in the combo. Does that make sense? I'm sorry if
I'm
making this really confusing.... If there is no id/date that matches the
combo, it want it to show me all records in the frmEntrepreneurAttendance.



Graham Mandeno said:
Well, it looks like all you need is to check if Combo16 is null:

If Not IsNull(Combo16) Then
stLinkCriteria = "[fkPresentDinnerID]=" & Me![Combo16]
End If

BTW, you should rename Combo16 to something more meaningful - say,
cboSelectDate.
--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand
 
G

Graham Mandeno

Heidi, some questions for you to answer:

1. Is "EntrepreneurID" the name of a control on the same form as your
"openEntAttendance" command button?

2. Does your code compile without errors? (Click Debug > Compile <project
name>)

3. Which line of code is throwing the erroe? (To find out, comment out the
"On Error Goto" line)

4. Does the code behave correctly if [EntrepreneurID] is NOT null (the
situation you say was working OK before)?

--
Soon...

Graham Mandeno [Access MVP]
Auckland, New Zealand

Heidi said:
I have tried that before but I get an error message (tried it again to be
sure):
"Microsoft Office Access can't find the field "|" referred to in your
expression"

Do I need some sort of syntax to designate that the control is located in
the other form? I don't know the syntax for that so I havne't been able to
test it... this is what i have in my code with what you suggested:

stDocName = "frmEntrepreneurAttendance"

If Not IsNull([EntrepreneurID]) Then
stLinkCriteria = "[fkPresentDinnerID]=" & Me![cmbfkDinnerID]
End If

DoCmd.OpenForm stDocName, , , stLinkCriteria


Thanks! :)

Graham Mandeno said:
Then you should use the expression:

If Not IsNull([control that contains the company ID]) Then
stLinkCriteria = ...


--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand

Heidi said:
Actually it's in the Company's form that I'm trying to check if null -
that's
why it's so confusing... The combo will never be null, so that's not my
issue, it's if the combo has an id and when I open the
frmEntrepreneurAttendance form, that date field in the source code is
either
null or matches the id in the combo. Does that make sense? I'm sorry if
I'm
making this really confusing.... If there is no id/date that matches
the
combo, it want it to show me all records in the
frmEntrepreneurAttendance.



:

Well, it looks like all you need is to check if Combo16 is null:

If Not IsNull(Combo16) Then
stLinkCriteria = "[fkPresentDinnerID]=" & Me![Combo16]
End If

BTW, you should rename Combo16 to something more meaningful - say,
cboSelectDate.
--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand
 
G

Guest

1. EntrepreneurID is the ID field in the table that is the control source for
the form itself. Pretty much everything in the form works off of that - the
drop down (ID and company name), The link fields between what the drop down
holds and the subform holding the details of the company, etc.

2. Yes, no errors on compile

3. the debugger stops on "If Not IsNull([EntrepreneurID]) Then", however it
still gives me the same error message when I comment out the OnError...

4. No, it still errors out. If i comment out the If statement, it works
fine, opening up the one company that matches (is not null).

Thanksa bunch!

Graham Mandeno said:
Heidi, some questions for you to answer:

1. Is "EntrepreneurID" the name of a control on the same form as your
"openEntAttendance" command button?

2. Does your code compile without errors? (Click Debug > Compile <project
name>)

3. Which line of code is throwing the erroe? (To find out, comment out the
"On Error Goto" line)

4. Does the code behave correctly if [EntrepreneurID] is NOT null (the
situation you say was working OK before)?

--
Soon...

Graham Mandeno [Access MVP]
Auckland, New Zealand

Heidi said:
I have tried that before but I get an error message (tried it again to be
sure):
"Microsoft Office Access can't find the field "|" referred to in your
expression"

Do I need some sort of syntax to designate that the control is located in
the other form? I don't know the syntax for that so I havne't been able to
test it... this is what i have in my code with what you suggested:

stDocName = "frmEntrepreneurAttendance"

If Not IsNull([EntrepreneurID]) Then
stLinkCriteria = "[fkPresentDinnerID]=" & Me![cmbfkDinnerID]
End If

DoCmd.OpenForm stDocName, , , stLinkCriteria


Thanks! :)

Graham Mandeno said:
Then you should use the expression:

If Not IsNull([control that contains the company ID]) Then
stLinkCriteria = ...


--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand

Actually it's in the Company's form that I'm trying to check if null -
that's
why it's so confusing... The combo will never be null, so that's not my
issue, it's if the combo has an id and when I open the
frmEntrepreneurAttendance form, that date field in the source code is
either
null or matches the id in the combo. Does that make sense? I'm sorry if
I'm
making this really confusing.... If there is no id/date that matches
the
combo, it want it to show me all records in the
frmEntrepreneurAttendance.



:

Well, it looks like all you need is to check if Combo16 is null:

If Not IsNull(Combo16) Then
stLinkCriteria = "[fkPresentDinnerID]=" & Me![Combo16]
End If

BTW, you should rename Combo16 to something more meaningful - say,
cboSelectDate.
--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand
 
G

Graham Mandeno

This is weird!

With the On Error commented out, run the code and, when it breaks at the
error, type:

?EntrepreneurID<enter>

in the debug window.

See what you get.

Also, try a compact and repair (Tools>database utilities)
--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand

Heidi said:
1. EntrepreneurID is the ID field in the table that is the control source
for
the form itself. Pretty much everything in the form works off of that -
the
drop down (ID and company name), The link fields between what the drop
down
holds and the subform holding the details of the company, etc.

2. Yes, no errors on compile

3. the debugger stops on "If Not IsNull([EntrepreneurID]) Then", however
it
still gives me the same error message when I comment out the OnError...

4. No, it still errors out. If i comment out the If statement, it works
fine, opening up the one company that matches (is not null).

Thanksa bunch!

Graham Mandeno said:
Heidi, some questions for you to answer:

1. Is "EntrepreneurID" the name of a control on the same form as your
"openEntAttendance" command button?

2. Does your code compile without errors? (Click Debug > Compile <project
name>)

3. Which line of code is throwing the erroe? (To find out, comment out
the
"On Error Goto" line)

4. Does the code behave correctly if [EntrepreneurID] is NOT null (the
situation you say was working OK before)?

--
Soon...

Graham Mandeno [Access MVP]
Auckland, New Zealand

Heidi said:
I have tried that before but I get an error message (tried it again to
be
sure):
"Microsoft Office Access can't find the field "|" referred to in your
expression"

Do I need some sort of syntax to designate that the control is located
in
the other form? I don't know the syntax for that so I havne't been able
to
test it... this is what i have in my code with what you suggested:

stDocName = "frmEntrepreneurAttendance"

If Not IsNull([EntrepreneurID]) Then
stLinkCriteria = "[fkPresentDinnerID]=" & Me![cmbfkDinnerID]
End If

DoCmd.OpenForm stDocName, , , stLinkCriteria


Thanks! :)

:

Then you should use the expression:

If Not IsNull([control that contains the company ID]) Then
stLinkCriteria = ...


--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand

Actually it's in the Company's form that I'm trying to check if
null -
that's
why it's so confusing... The combo will never be null, so that's not
my
issue, it's if the combo has an id and when I open the
frmEntrepreneurAttendance form, that date field in the source code
is
either
null or matches the id in the combo. Does that make sense? I'm sorry
if
I'm
making this really confusing.... If there is no id/date that matches
the
combo, it want it to show me all records in the
frmEntrepreneurAttendance.



:

Well, it looks like all you need is to check if Combo16 is null:

If Not IsNull(Combo16) Then
stLinkCriteria = "[fkPresentDinnerID]=" & Me![Combo16]
End If

BTW, you should rename Combo16 to something more meaningful - say,
cboSelectDate.
--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand
 
G

Guest

Yeah, you're telling me! At least I feel a bit better that I'm not totally
off my rocker and was thinking in the right direction.... :)

You'll have to forgive me, I've programmed in C++ and Cobol but not a ton in
VB so I'm kind of mucking my way thru it.... I know of the debug window in C,
but can't find it here - do you mean the watch?

If it is the watch, it just says for Value - expression not defined in
context, the Type- empty. Is that what you mean?

I tried a compact/repair and it still gives me the error.... :(

Thanks and I look forward to hearing from you!

Graham Mandeno said:
This is weird!

With the On Error commented out, run the code and, when it breaks at the
error, type:

?EntrepreneurID<enter>

in the debug window.

See what you get.

Also, try a compact and repair (Tools>database utilities)
--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand

Heidi said:
1. EntrepreneurID is the ID field in the table that is the control source
for
the form itself. Pretty much everything in the form works off of that -
the
drop down (ID and company name), The link fields between what the drop
down
holds and the subform holding the details of the company, etc.

2. Yes, no errors on compile

3. the debugger stops on "If Not IsNull([EntrepreneurID]) Then", however
it
still gives me the same error message when I comment out the OnError...

4. No, it still errors out. If i comment out the If statement, it works
fine, opening up the one company that matches (is not null).

Thanksa bunch!

Graham Mandeno said:
Heidi, some questions for you to answer:

1. Is "EntrepreneurID" the name of a control on the same form as your
"openEntAttendance" command button?

2. Does your code compile without errors? (Click Debug > Compile <project
name>)

3. Which line of code is throwing the erroe? (To find out, comment out
the
"On Error Goto" line)

4. Does the code behave correctly if [EntrepreneurID] is NOT null (the
situation you say was working OK before)?

--
Soon...

Graham Mandeno [Access MVP]
Auckland, New Zealand

I have tried that before but I get an error message (tried it again to
be
sure):
"Microsoft Office Access can't find the field "|" referred to in your
expression"

Do I need some sort of syntax to designate that the control is located
in
the other form? I don't know the syntax for that so I havne't been able
to
test it... this is what i have in my code with what you suggested:

stDocName = "frmEntrepreneurAttendance"

If Not IsNull([EntrepreneurID]) Then
stLinkCriteria = "[fkPresentDinnerID]=" & Me![cmbfkDinnerID]
End If

DoCmd.OpenForm stDocName, , , stLinkCriteria


Thanks! :)

:

Then you should use the expression:

If Not IsNull([control that contains the company ID]) Then
stLinkCriteria = ...


--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand

Actually it's in the Company's form that I'm trying to check if
null -
that's
why it's so confusing... The combo will never be null, so that's not
my
issue, it's if the combo has an id and when I open the
frmEntrepreneurAttendance form, that date field in the source code
is
either
null or matches the id in the combo. Does that make sense? I'm sorry
if
I'm
making this really confusing.... If there is no id/date that matches
the
combo, it want it to show me all records in the
frmEntrepreneurAttendance.



:

Well, it looks like all you need is to check if Combo16 is null:

If Not IsNull(Combo16) Then
stLinkCriteria = "[fkPresentDinnerID]=" & Me![Combo16]
End If

BTW, you should rename Combo16 to something more meaningful - say,
cboSelectDate.
--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand
 
G

Graham Mandeno

Sorry, Heidi - I meant the "Immediate" window.

Do you have "Option Explicit" at the top of this module (and ALL your other
modules as well)? If not, add it in (to this form module at least) and try
compiling again.

It sounds to me like nothing exists in the current scope named
"EntrepreneurID" so it is being implicitly declared.
--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand

Heidi said:
Yeah, you're telling me! At least I feel a bit better that I'm not totally
off my rocker and was thinking in the right direction.... :)

You'll have to forgive me, I've programmed in C++ and Cobol but not a ton
in
VB so I'm kind of mucking my way thru it.... I know of the debug window in
C,
but can't find it here - do you mean the watch?

If it is the watch, it just says for Value - expression not defined in
context, the Type- empty. Is that what you mean?

I tried a compact/repair and it still gives me the error.... :(

Thanks and I look forward to hearing from you!

Graham Mandeno said:
This is weird!

With the On Error commented out, run the code and, when it breaks at the
error, type:

?EntrepreneurID<enter>

in the debug window.

See what you get.

Also, try a compact and repair (Tools>database utilities)
--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand

Heidi said:
1. EntrepreneurID is the ID field in the table that is the control
source
for
the form itself. Pretty much everything in the form works off of that -
the
drop down (ID and company name), The link fields between what the drop
down
holds and the subform holding the details of the company, etc.

2. Yes, no errors on compile

3. the debugger stops on "If Not IsNull([EntrepreneurID]) Then",
however
it
still gives me the same error message when I comment out the OnError...

4. No, it still errors out. If i comment out the If statement, it works
fine, opening up the one company that matches (is not null).

Thanksa bunch!

:

Heidi, some questions for you to answer:

1. Is "EntrepreneurID" the name of a control on the same form as your
"openEntAttendance" command button?

2. Does your code compile without errors? (Click Debug > Compile
<project
name>)

3. Which line of code is throwing the erroe? (To find out, comment
out
the
"On Error Goto" line)

4. Does the code behave correctly if [EntrepreneurID] is NOT null (the
situation you say was working OK before)?

--
Soon...

Graham Mandeno [Access MVP]
Auckland, New Zealand

I have tried that before but I get an error message (tried it again
to
be
sure):
"Microsoft Office Access can't find the field "|" referred to in
your
expression"

Do I need some sort of syntax to designate that the control is
located
in
the other form? I don't know the syntax for that so I havne't been
able
to
test it... this is what i have in my code with what you suggested:

stDocName = "frmEntrepreneurAttendance"

If Not IsNull([EntrepreneurID]) Then
stLinkCriteria = "[fkPresentDinnerID]=" & Me![cmbfkDinnerID]
End If

DoCmd.OpenForm stDocName, , , stLinkCriteria


Thanks! :)

:

Then you should use the expression:

If Not IsNull([control that contains the company ID]) Then
stLinkCriteria = ...


--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand

Actually it's in the Company's form that I'm trying to check if
null -
that's
why it's so confusing... The combo will never be null, so that's
not
my
issue, it's if the combo has an id and when I open the
frmEntrepreneurAttendance form, that date field in the source
code
is
either
null or matches the id in the combo. Does that make sense? I'm
sorry
if
I'm
making this really confusing.... If there is no id/date that
matches
the
combo, it want it to show me all records in the
frmEntrepreneurAttendance.



:

Well, it looks like all you need is to check if Combo16 is null:

If Not IsNull(Combo16) Then
stLinkCriteria = "[fkPresentDinnerID]=" & Me![Combo16]
End If

BTW, you should rename Combo16 to something more meaningful -
say,
cboSelectDate.
--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand
 
G

Guest

Graham,

Yes, I do have Option Explicit in all of my modules, so it should be fine as
far as that is concerned....

As far as the immediate window, when I tried to run and then debug w/
?EntrepreneurID, it just enters thru to another line and the cursor just
waits. No data or value is returned....



Graham Mandeno said:
Sorry, Heidi - I meant the "Immediate" window.

Do you have "Option Explicit" at the top of this module (and ALL your other
modules as well)? If not, add it in (to this form module at least) and try
compiling again.

It sounds to me like nothing exists in the current scope named
"EntrepreneurID" so it is being implicitly declared.
--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand

Heidi said:
Yeah, you're telling me! At least I feel a bit better that I'm not totally
off my rocker and was thinking in the right direction.... :)

You'll have to forgive me, I've programmed in C++ and Cobol but not a ton
in
VB so I'm kind of mucking my way thru it.... I know of the debug window in
C,
but can't find it here - do you mean the watch?

If it is the watch, it just says for Value - expression not defined in
context, the Type- empty. Is that what you mean?

I tried a compact/repair and it still gives me the error.... :(

Thanks and I look forward to hearing from you!

Graham Mandeno said:
This is weird!

With the On Error commented out, run the code and, when it breaks at the
error, type:

?EntrepreneurID<enter>

in the debug window.

See what you get.

Also, try a compact and repair (Tools>database utilities)
--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand

1. EntrepreneurID is the ID field in the table that is the control
source
for
the form itself. Pretty much everything in the form works off of that -
the
drop down (ID and company name), The link fields between what the drop
down
holds and the subform holding the details of the company, etc.

2. Yes, no errors on compile

3. the debugger stops on "If Not IsNull([EntrepreneurID]) Then",
however
it
still gives me the same error message when I comment out the OnError...

4. No, it still errors out. If i comment out the If statement, it works
fine, opening up the one company that matches (is not null).

Thanksa bunch!

:

Heidi, some questions for you to answer:

1. Is "EntrepreneurID" the name of a control on the same form as your
"openEntAttendance" command button?

2. Does your code compile without errors? (Click Debug > Compile
<project
name>)

3. Which line of code is throwing the erroe? (To find out, comment
out
the
"On Error Goto" line)

4. Does the code behave correctly if [EntrepreneurID] is NOT null (the
situation you say was working OK before)?

--
Soon...

Graham Mandeno [Access MVP]
Auckland, New Zealand

I have tried that before but I get an error message (tried it again
to
be
sure):
"Microsoft Office Access can't find the field "|" referred to in
your
expression"

Do I need some sort of syntax to designate that the control is
located
in
the other form? I don't know the syntax for that so I havne't been
able
to
test it... this is what i have in my code with what you suggested:

stDocName = "frmEntrepreneurAttendance"

If Not IsNull([EntrepreneurID]) Then
stLinkCriteria = "[fkPresentDinnerID]=" & Me![cmbfkDinnerID]
End If

DoCmd.OpenForm stDocName, , , stLinkCriteria


Thanks! :)

:

Then you should use the expression:

If Not IsNull([control that contains the company ID]) Then
stLinkCriteria = ...


--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand

Actually it's in the Company's form that I'm trying to check if
null -
that's
why it's so confusing... The combo will never be null, so that's
not
my
issue, it's if the combo has an id and when I open the
frmEntrepreneurAttendance form, that date field in the source
code
is
either
null or matches the id in the combo. Does that make sense? I'm
sorry
if
I'm
making this really confusing.... If there is no id/date that
matches
the
combo, it want it to show me all records in the
frmEntrepreneurAttendance.



:

Well, it looks like all you need is to check if Combo16 is null:

If Not IsNull(Combo16) Then
stLinkCriteria = "[fkPresentDinnerID]=" & Me![Combo16]
End If

BTW, you should rename Combo16 to something more meaningful -
say,
cboSelectDate.
--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand
 
G

Graham Mandeno

No data or value is returned....

Ah... that suggests that, for some reason, EntrepreneurID is either Empty
(an uninitialised variant) or contains a zero-length string.

You could change your test to the following:
If Len(EntrepreneurID & "") > 0 then

This would cover all three cases - Null, Empty, or ZLS.

However, I suspect that the *real* EntrepreneurID cannot be any of these
things, because in an earlier post you said:
1. EntrepreneurID is the ID field in the table that is the control source
for
the form itself. Pretty much everything in the form works off of that -
the
drop down (ID and company name), The link fields between what the drop
down
holds and the subform holding the details of the company, etc.

Try this: Make sure you are on a record where you *know* what
EntrepreneurID *ought* to be, then set a breakpoint at your If line and try
the following in the immediate window:

?EntrepreneurID
?Me.EntrepreneurID
?Me!EntrepreneurID
?IsNull(EntrepreneurID)
?IsEmpty(EntrepreneurID)
?EntrepreneurID=""

Report back with the result of each of these six lines. If the cursor just
stays blinking under a blank line, then report the result as <blank>.
 
G

Guest

Ok, w/the first one - changing the If statement, it returns an OnClick error:
the Variable is not defined.

As for the others - I'm not sure I know how I can do this.... The main form
(frmAttendance) just has a command button that opens up the 2nd form
(frmEntrepreneurAttendance). How do I get to be "on" a record when it's not
designated to choose a certain record? But then, maybe the first test negates
the second?

Here's what I'm thinking and tell me if I'm totally off because even if I'm
right, I still don't know how to fix it......The frmAttendance has the
command button w/the code to pull records if some value in EntrpreneurID
exists... but here's the thing - where in the code is it saying the
EntrepreneurID is in the frmEntrepreneurAttendance and not in frmAttendance?
In other words, it may be a null value because it literally doesn't exist as
far as the code is concerned because I'm not pointing it to the other form...
But if thta is true, how do i fix that? Or am I making this more difficult
than it really is?

Thanks!

Graham Mandeno said:
No data or value is returned....

Ah... that suggests that, for some reason, EntrepreneurID is either Empty
(an uninitialised variant) or contains a zero-length string.

You could change your test to the following:
If Len(EntrepreneurID & "") > 0 then

This would cover all three cases - Null, Empty, or ZLS.

However, I suspect that the *real* EntrepreneurID cannot be any of these
things, because in an earlier post you said:
1. EntrepreneurID is the ID field in the table that is the control source
for
the form itself. Pretty much everything in the form works off of that -
the
drop down (ID and company name), The link fields between what the drop
down
holds and the subform holding the details of the company, etc.

Try this: Make sure you are on a record where you *know* what
EntrepreneurID *ought* to be, then set a breakpoint at your If line and try
the following in the immediate window:

?EntrepreneurID
?Me.EntrepreneurID
?Me!EntrepreneurID
?IsNull(EntrepreneurID)
?IsEmpty(EntrepreneurID)
?EntrepreneurID=""

Report back with the result of each of these six lines. If the cursor just
stays blinking under a blank line, then report the result as <blank>.
--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand


Heidi said:
Graham,

Yes, I do have Option Explicit in all of my modules, so it should be fine
as
far as that is concerned....

As far as the immediate window, when I tried to run and then debug w/
?EntrepreneurID, it just enters thru to another line and the cursor just
waits. No data or value is returned....
 
G

Graham Mandeno

Hi Heidi

Inline...
Ok, w/the first one - changing the If statement, it returns an OnClick
error:
the Variable is not defined.

This is what I first suspected (that EntrepreneurID is not defined), which
is why I asked if you had Option Explicit.

I cannot understand though, why
If Not IsNull(EntrepreneurID) Then
should compile OK, while
If Len(EntrepreneurID & "") > 0 Then
does not.

I feel I'm not getting all the information here.
As for the others - I'm not sure I know how I can do this.... The main
form
(frmAttendance) just has a command button that opens up the 2nd form
(frmEntrepreneurAttendance). How do I get to be "on" a record when it's
not
designated to choose a certain record? But then, maybe the first test
negates
the second?

So you're saying that the first form is unbound (has no recordset)? I have
been labouring under the misapprehension that your first form has a control
named EntrepreneurID (or at least a field in its RecordSource of that name).
But it just has a combobox with a list of dates, right? Where do those
dates come from?

How about you give me a comprehensive description of your table structures
and their relationships, and what is on the two forms - what is the
RecordSource and what is the ControlSource of the controls, and the
RowSource of any comboboxes.

With any luck we'll get this nailed by Christmas :)
 
G

Guest

I'm sorry I'm not being so clear on this... If it makes it easier, i can
email you the db, just let me know...

Ok.....the main form is bound but it's not bound to the same table -
frmAttendance is bound to tblAttendance, frmEntrepreneurAttendance is bound
to 2 joined tables, tblAttendancePresenter and tblEntrepreneur. Yes, the
frmAtt has the combobox w/just a list of dates from tblDinnerDates,
containing an ID (hidden in the combo) and a date.

Here is the detailed info on the sources:

frmAttendance w/source tblAttendance, fields below:
-pkAttendanceID
-fkDinnerID (to join w/the Dinner ID in the tblDinnerDates)
-Name (contains full name of investor/angel attendee)
-fkAngelID (ID to join with the ID in tblAngel containing investor info)
-fkSubID (ID to join with the ID in tblSub - holds any subs for the angel
investor)
Form contains combo box sourced to tblDinnerDates (explained above). This
form contains a few list boxes for attendance but then a command button to
add presenters to the attendance.

frmEntrepreneurAttendance w/source tblAttendancePresenter joined to
tblEntrepreneur (1st tbl field: fkEntrepreneurID joined to 2nd tbl
EntrepreneurID), only listing pertinent fields because there are too many and
not many used:
-EntrepreneurID
-Company (company name, criteria: is not null)
-PresenterCount (user defined entry - how many presenters are attending for
this company)
-fkPresentDinnerID ("gets" the ID of the dinner date when command button on
this form is clicked - activates action qry)
Combo box on this form containing EntrepreneurID and Company from
tblEntrepreneur. When company is selected, the linked subform shows specific
company information (linked on EntrepreneurID).

Do you need anything more?

Thanks again, I appreciate your time!!
Heidi :)




Graham Mandeno said:
Hi Heidi

Inline...
Ok, w/the first one - changing the If statement, it returns an OnClick
error:
the Variable is not defined.

This is what I first suspected (that EntrepreneurID is not defined), which
is why I asked if you had Option Explicit.

I cannot understand though, why
If Not IsNull(EntrepreneurID) Then
should compile OK, while
If Len(EntrepreneurID & "") > 0 Then
does not.

I feel I'm not getting all the information here.
As for the others - I'm not sure I know how I can do this.... The main
form
(frmAttendance) just has a command button that opens up the 2nd form
(frmEntrepreneurAttendance). How do I get to be "on" a record when it's
not
designated to choose a certain record? But then, maybe the first test
negates
the second?

So you're saying that the first form is unbound (has no recordset)? I have
been labouring under the misapprehension that your first form has a control
named EntrepreneurID (or at least a field in its RecordSource of that name).
But it just has a combobox with a list of dates, right? Where do those
dates come from?

How about you give me a comprehensive description of your table structures
and their relationships, and what is on the two forms - what is the
RecordSource and what is the ControlSource of the controls, and the
RowSource of any comboboxes.

With any luck we'll get this nailed by Christmas :)
--

Graham Mandeno [Access MVP]
Auckland, New Zealand
Here's what I'm thinking and tell me if I'm totally off because even if
I'm
right, I still don't know how to fix it......The frmAttendance has the
command button w/the code to pull records if some value in EntrpreneurID
exists... but here's the thing - where in the code is it saying the
EntrepreneurID is in the frmEntrepreneurAttendance and not in
frmAttendance?
In other words, it may be a null value because it literally doesn't exist
as
far as the code is concerned because I'm not pointing it to the other
form...
But if thta is true, how do i fix that? Or am I making this more difficult
than it really is?
 
G

Graham Mandeno

Hi Heidi

Do you mean that if the DinnerID in cmbfkDinnerID has any corresponding
records in tblAttendancePresenter then you want to open the form
frmEntrepreneurAttendance with those records listed, but if there are no
matching records you want to open frmEntrepreneurAttendance whowing ALL the
records, whether they match the combo or not?

If so, then try this:

stDocName = "frmEntrepreneurAttendance"
stLinkCriteria = "[fkPresentDinnerID]=" & Me![cmbfkDinnerID]
If DCount( "*", "tblAttendancePresenter", stLinkCriteria ) = 0 Then
DoCmd.OpenForm stDocName
Else
DoCmd.OpenForm stDocName, , , stLinkCriteria
End If

If that's not what you want, and the database is not too large, email me a
zipped copy at graham-at-mvps-dot-org. I wouldn't normally invite someone
to do this, but we seem to be going around in circles :)

Oh, and I will be going away on my holidays tomorrow and will be travelling,
so I might not get back online for more than 24 hours from now.
--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand


Heidi said:
I'm sorry I'm not being so clear on this... If it makes it easier, i can
email you the db, just let me know...

Ok.....the main form is bound but it's not bound to the same table -
frmAttendance is bound to tblAttendance, frmEntrepreneurAttendance is
bound
to 2 joined tables, tblAttendancePresenter and tblEntrepreneur. Yes, the
frmAtt has the combobox w/just a list of dates from tblDinnerDates,
containing an ID (hidden in the combo) and a date.

Here is the detailed info on the sources:

frmAttendance w/source tblAttendance, fields below:
-pkAttendanceID
-fkDinnerID (to join w/the Dinner ID in the tblDinnerDates)
-Name (contains full name of investor/angel attendee)
-fkAngelID (ID to join with the ID in tblAngel containing investor info)
-fkSubID (ID to join with the ID in tblSub - holds any subs for the angel
investor)
Form contains combo box sourced to tblDinnerDates (explained above). This
form contains a few list boxes for attendance but then a command button to
add presenters to the attendance.

frmEntrepreneurAttendance w/source tblAttendancePresenter joined to
tblEntrepreneur (1st tbl field: fkEntrepreneurID joined to 2nd tbl
EntrepreneurID), only listing pertinent fields because there are too many
and
not many used:
-EntrepreneurID
-Company (company name, criteria: is not null)
-PresenterCount (user defined entry - how many presenters are attending
for
this company)
-fkPresentDinnerID ("gets" the ID of the dinner date when command button
on
this form is clicked - activates action qry)
Combo box on this form containing EntrepreneurID and Company from
tblEntrepreneur. When company is selected, the linked subform shows
specific
company information (linked on EntrepreneurID).

Do you need anything more?

Thanks again, I appreciate your time!!
Heidi :)




Graham Mandeno said:
Hi Heidi

Inline...
Ok, w/the first one - changing the If statement, it returns an OnClick
error:
the Variable is not defined.

This is what I first suspected (that EntrepreneurID is not defined),
which
is why I asked if you had Option Explicit.

I cannot understand though, why
If Not IsNull(EntrepreneurID) Then
should compile OK, while
If Len(EntrepreneurID & "") > 0 Then
does not.

I feel I'm not getting all the information here.
As for the others - I'm not sure I know how I can do this.... The main
form
(frmAttendance) just has a command button that opens up the 2nd form
(frmEntrepreneurAttendance). How do I get to be "on" a record when it's
not
designated to choose a certain record? But then, maybe the first test
negates
the second?

So you're saying that the first form is unbound (has no recordset)? I
have
been labouring under the misapprehension that your first form has a
control
named EntrepreneurID (or at least a field in its RecordSource of that
name).
But it just has a combobox with a list of dates, right? Where do those
dates come from?

How about you give me a comprehensive description of your table
structures
and their relationships, and what is on the two forms - what is the
RecordSource and what is the ControlSource of the controls, and the
RowSource of any comboboxes.

With any luck we'll get this nailed by Christmas :)
--

Graham Mandeno [Access MVP]
Auckland, New Zealand
Here's what I'm thinking and tell me if I'm totally off because even if
I'm
right, I still don't know how to fix it......The frmAttendance has the
command button w/the code to pull records if some value in
EntrpreneurID
exists... but here's the thing - where in the code is it saying the
EntrepreneurID is in the frmEntrepreneurAttendance and not in
frmAttendance?
In other words, it may be a null value because it literally doesn't
exist
as
far as the code is concerned because I'm not pointing it to the other
form...
But if thta is true, how do i fix that? Or am I making this more
difficult
than it really is?
 

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

Top