Date Type Mismatch

J

JB

I have a main form with a subform. The subform also contains a
subform. On the main form is a text box that contains the following
code in the data source of the PrintCount field:
=(DCount("PrintID","tblPrint","FilmNumber =" & FilmID])

In the primary subform's Form_Current event, I refer to the value of
this field on the mainform using this code:
If Forms!AA_frmFilms!PrintCount > 1 Then

When the forms originally load, the code executes and the PrintCount
reference on the subform works as expected. If I then click on a
button on this subform to save the edited contents of the subform
record, the code executes again and I get a Error 13 Type Mismatch
error. I have tried a variety of techniques including different
reference methods and even converting the original value of PrintCount
to an Integer. Nothing works. If I do not have a break set at this
line, the application completely crashes and Access shuts down.

Does anyone have a suggestion?
 
S

Stefan Hoffmann

hi JB,
In the primary subform's Form_Current event, I refer to the value of
this field on the mainform using this code:
If Forms!AA_frmFilms!PrintCount > 1 Then
I normally use

Forms("AA_frmFilms").Form.PrintCount.Value

But as it is a subform, you may try

Parent.Form.PrintCount.Value
If I do not have a break set at this
line, the application completely crashes and Access shuts down.
This sounds odd. Have you already run repair and compare on your database?


mfG
--> stefan <--
 

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