DefaultValue Property

Ally

Registered User.
Local time
Today, 05:24
Joined
Sep 18, 2001
Messages
617
I have 2 main episode forms frmEpisode and frmEpisodeDE - (one's data entry and the other's for updating). From either of these you can add a FU Data episode. In the UnitNo and ITURegNo fields on the frmFUData I want it to refer to the relevant field on the episode form.

In the DefaultValue property I have tried:

=IIf(IsLoaded([Forms]![frmEpisode]),[Forms]![frmEpisode]![UnitNo],[Forms]![frmEpisodeDE]![UnitNo])

... using the IsLoaded function from Northwind, but it returns #Error.

Am I able to use code like this in the DefaultValue property?

Anyone know what can I do please?
 
Last edited:
Ally,

I'm not sure (then why is he responding, you ask) but, the If statement below doesn't see to have any value for the false result...for true result you indicate the value as frmepisode.unitno but for false the value ends with the other form name and no value...

=IIf(IsLoaded([Forms]![frmEpisode]),[Forms]![frmEpisode]![UnitNo],[Forms]![frmEpisodeDE])

Shouldn't there be a value there?

Cheers

Dennis
 
Oops - there was a bit missing. Have amended it now. Although, my IIfs are always a bit iffy, as far as I can see it "should" be okay.

=IIf(IsLoaded([Forms]![frmEpisode]),[Forms]![frmEpisode]![UnitNo],[Forms]![frmEpisodeDE]![UnitNo])


Expression:=IIf(IsLoaded([Forms]![frmEpisode]),

truepart:[Forms]![frmEpisode]![UnitNo],

falsepart:[Forms]![frmEpisodeDE]![UnitNo])
 
All right, another question...

Is there any case where neither form would be loaded?

:)
 
I have tried this, but for some reason I kept getting an error message which is why I did a separate data-entry form:

Run-time Error 3021

No current record
... debug

It hightlights:
Code:
recClone.Bookmark = Me.Bookmark

This is code that is there for my own navigation buttons. I have just found tho, that if I comment out the msgbox Err.Description that it does work sometimes, but not always.

Not sure why it would give me the error message?
 
Last edited:

Users who are viewing this thread

Back
Top Bottom