What could be main reason(s) for this error message?

A

Alp Bekisoglu

Hi Experts,

I'm getting the following error on making a selection via comboBox on a
form. The form name and the cboBox name does match exactly on the query
(append) behind. Error is:

Run-time error '3070'
The Microsoft Jet database engine does not recognize
'[Forms]![frmStgChrt]![cboEvnID]' as a valid field name or expression.

I have checked the data in the VB immediate window and did get the result
without a hitch!
?Forms!frmStgChrt!cboEvnID returned 1 which is correct.

This prevents the form from properly displaying the detail section. Actually
nothing gets displayed.

If further info would be required, just let me know.

Thanks in advance.

Alp
 
A

Allen Browne

The detail section of a form goes completely blank if:
a) there are no records to display, and
b) no new records can be added.

Then trying to refer to the non-existent controls in the detail section
generates an error. Even referring to the visible controls in the Form
Header/Footer is likely to generate an error also, as explained here:
http://allenbrowne.com/bug-06.html

So, if you are filtering the form such that it returns no records, and new
records cannot be added, you can trigger this situation. If the form is not
based on a non-updatable query, you might be able to avoid the situation
just by setting the form's AllowAdditions property to Yes. You can then
block new records by cancelling the form's BeforeInsert event.

There are other possible causes also. If you have this reference in the
query that feeds frmStgChrt, the query needs to evaluate the expression
before it can supply records to the form, and the form needs to get its data
from the query before it can do anything, so it could be a timing issue.

Another possible reason is that Name AutoCorrect has confused Access. More
info on this, and why you want to turn it off:
http://allenbrowne.com/bug-03.html
 
A

Alp Bekisoglu

Hi Allen,

Thanks for your response. This actually is a modified version of Duane's
Seating database.

All was going well, I had made quite a few accomplishments and all that.
Then The form started giving me this error and eversince it (the db) refuses
to "see" that the form is opened and a choice is actually made.

Thinking it could be the string format returned, I changed the link to the
form's feld to CLng(...) but that didn't help as well.

There is one interesting thing going on though and I've started to suspect
the DB has gone corrupt. When I make changes to the query it doesn't even
ask to save! Do you think I should do a decompile and recompile? (Eventhough
I forgot how I should do that, but I can find it I guess)

Alp

Allen Browne said:
The detail section of a form goes completely blank if:
a) there are no records to display, and
b) no new records can be added.

Then trying to refer to the non-existent controls in the detail section
generates an error. Even referring to the visible controls in the Form
Header/Footer is likely to generate an error also, as explained here:
http://allenbrowne.com/bug-06.html

So, if you are filtering the form such that it returns no records, and new
records cannot be added, you can trigger this situation. If the form is
not based on a non-updatable query, you might be able to avoid the
situation just by setting the form's AllowAdditions property to Yes. You
can then block new records by cancelling the form's BeforeInsert event.

There are other possible causes also. If you have this reference in the
query that feeds frmStgChrt, the query needs to evaluate the expression
before it can supply records to the form, and the form needs to get its
data from the query before it can do anything, so it could be a timing
issue.

Another possible reason is that Name AutoCorrect has confused Access. More
info on this, and why you want to turn it off:
http://allenbrowne.com/bug-03.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Alp Bekisoglu said:
I'm getting the following error on making a selection via comboBox on a
form. The form name and the cboBox name does match exactly on the query
(append) behind. Error is:

Run-time error '3070'
The Microsoft Jet database engine does not recognize
'[Forms]![frmStgChrt]![cboEvnID]' as a valid field name or expression.

I have checked the data in the VB immediate window and did get the result
without a hitch!
?Forms!frmStgChrt!cboEvnID returned 1 which is correct.

This prevents the form from properly displaying the detail section.
Actually nothing gets displayed.

If further info would be required, just let me know.

Thanks in advance.

Alp
 
A

Allen Browne

Decompile if you wish.

Enter something like this at the command prompt while Access is not running.
It is all one line, and include the quotes:
"c:\Program Files\Microsoft office\office\msaccess.exe" /decompile
"c:\MyPath\MyDatabase.mdb"

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Alp Bekisoglu said:
Hi Allen,

Thanks for your response. This actually is a modified version of Duane's
Seating database.

All was going well, I had made quite a few accomplishments and all that.
Then The form started giving me this error and eversince it (the db)
refuses to "see" that the form is opened and a choice is actually made.

Thinking it could be the string format returned, I changed the link to the
form's feld to CLng(...) but that didn't help as well.

There is one interesting thing going on though and I've started to suspect
the DB has gone corrupt. When I make changes to the query it doesn't even
ask to save! Do you think I should do a decompile and recompile?
(Eventhough I forgot how I should do that, but I can find it I guess)

Alp

Allen Browne said:
The detail section of a form goes completely blank if:
a) there are no records to display, and
b) no new records can be added.

Then trying to refer to the non-existent controls in the detail section
generates an error. Even referring to the visible controls in the Form
Header/Footer is likely to generate an error also, as explained here:
http://allenbrowne.com/bug-06.html

So, if you are filtering the form such that it returns no records, and
new records cannot be added, you can trigger this situation. If the form
is not based on a non-updatable query, you might be able to avoid the
situation just by setting the form's AllowAdditions property to Yes. You
can then block new records by cancelling the form's BeforeInsert event.

There are other possible causes also. If you have this reference in the
query that feeds frmStgChrt, the query needs to evaluate the expression
before it can supply records to the form, and the form needs to get its
data from the query before it can do anything, so it could be a timing
issue.

Another possible reason is that Name AutoCorrect has confused Access.
More info on this, and why you want to turn it off:
http://allenbrowne.com/bug-03.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Alp Bekisoglu said:
I'm getting the following error on making a selection via comboBox on a
form. The form name and the cboBox name does match exactly on the query
(append) behind. Error is:

Run-time error '3070'
The Microsoft Jet database engine does not recognize
'[Forms]![frmStgChrt]![cboEvnID]' as a valid field name or expression.

I have checked the data in the VB immediate window and did get the
result without a hitch!
?Forms!frmStgChrt!cboEvnID returned 1 which is correct.

This prevents the form from properly displaying the detail section.
Actually nothing gets displayed.

If further info would be required, just let me know.

Thanks in advance.

Alp
 
A

Alp Bekisoglu

Hi Allen,

Well, that did not help either and I finally put the query behind the form
in code and had to do away with the PARAMETERS part. But now it seems to be
working at least.

I am now trying to deal with yet another problem; the form's close button
closing the whole application!

There is code behind the close button to delete all entries from a table,
like;
DoCmd.SetWarnings False
DoCmd.RunSQL "DELETE * FROM tblTempSeatingTamAalt"
DoCmd.SetWarnings True
DoCmd.Close

thinking it might change I replaced it with:
DoCmd.SetWarnings False
CurrentDb.Execute "DELETE * FROM tblTempSeatingTamAalt", dbFailOnError
DoCmd.SetWarnings True
DoCmd.Close

but still Access closes on the click of the button! I hope I'll be able to
find out why before I go bananas.

Alp

Allen Browne said:
Decompile if you wish.

Enter something like this at the command prompt while Access is not
running. It is all one line, and include the quotes:
"c:\Program Files\Microsoft office\office\msaccess.exe" /decompile
"c:\MyPath\MyDatabase.mdb"

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Alp Bekisoglu said:
Hi Allen,

Thanks for your response. This actually is a modified version of Duane's
Seating database.

All was going well, I had made quite a few accomplishments and all that.
Then The form started giving me this error and eversince it (the db)
refuses to "see" that the form is opened and a choice is actually made.

Thinking it could be the string format returned, I changed the link to
the form's feld to CLng(...) but that didn't help as well.

There is one interesting thing going on though and I've started to
suspect the DB has gone corrupt. When I make changes to the query it
doesn't even ask to save! Do you think I should do a decompile and
recompile? (Eventhough I forgot how I should do that, but I can find it I
guess)

Alp

Allen Browne said:
The detail section of a form goes completely blank if:
a) there are no records to display, and
b) no new records can be added.

Then trying to refer to the non-existent controls in the detail section
generates an error. Even referring to the visible controls in the Form
Header/Footer is likely to generate an error also, as explained here:
http://allenbrowne.com/bug-06.html

So, if you are filtering the form such that it returns no records, and
new records cannot be added, you can trigger this situation. If the form
is not based on a non-updatable query, you might be able to avoid the
situation just by setting the form's AllowAdditions property to Yes. You
can then block new records by cancelling the form's BeforeInsert event.

There are other possible causes also. If you have this reference in the
query that feeds frmStgChrt, the query needs to evaluate the expression
before it can supply records to the form, and the form needs to get its
data from the query before it can do anything, so it could be a timing
issue.

Another possible reason is that Name AutoCorrect has confused Access.
More info on this, and why you want to turn it off:
http://allenbrowne.com/bug-03.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.


I'm getting the following error on making a selection via comboBox on a
form. The form name and the cboBox name does match exactly on the query
(append) behind. Error is:

Run-time error '3070'
The Microsoft Jet database engine does not recognize
'[Forms]![frmStgChrt]![cboEvnID]' as a valid field name or expression.

I have checked the data in the VB immediate window and did get the
result without a hitch!
?Forms!frmStgChrt!cboEvnID returned 1 which is correct.

This prevents the form from properly displaying the detail section.
Actually nothing gets displayed.

If further info would be required, just let me know.

Thanks in advance.

Alp
 
A

Allen Browne

Make sure the Name AutoCorrect boxes are unchecked under:
Tools | Options | General

Compact the database:
Tools | Database Utilities | Compact

If the form is bound to a table, save or undo the record first.

Try executing the query instead of RunSql. This avoids the need to turn
SetWarnings off, and informs you if the detail fails.

Specify the form to close.

Result:
If Me.Dirty Then Me.Dirty = False
dbEngine(0)(0).Execute "DELETE FROM tblTempSeatingTamAalt;",
dbFailOnError
DoCmd.Close acForm, Me.name

If you see no error message that Access has been "shut down by Windows", you
might check the Unload or Close event of the form, to see if it is executing
a Quit.
 
A

Alp Bekisoglu

Thanks Allen, that "If Me.Dirty Then Me.Dirty = False" has done the trick.

Have a great day.

Alp
 

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