Hi gang,
Banging my head on the wall with this one:
I have a main form 'formadmintestmain' which has a continuous subform
'formadmintestpage1' on it. On this subform is a combobox (Combo55) that
saves its' data in field 'RQSTED_RANK'. Everything works as it should. What I
am TRYING to do is get this combo box to have a default value when
RQSTED_RANK is NULL:
If IsNull(Me.RQSTED_RANK) Then Me.Combo55 = DLookup("BELT_RANK", "STUDENTS",
"STUDENT_ID=" & Me.STUDENT_ID) + 1
This code works fine in a different form that have that does one student_id
record at a time, but I cannot get this to work for my continuous form. I'm
not exactly sure which event would be the best place to put this, either;
should it go in the On Current of the subform, the after update of the combo
box I use to select the main record from, or what? Any help will be greatly
appreciated!
Andy

Signature
A $300 dollar picture tube will protect a 10 cent fuse by blowing first-
Murphy
Barry Gilbert - 03 Apr 2006 19:49 GMT
Instead of using an event, try putting the expression in the combobox's
Default Value property (using IIF).
By the way, don't bang your head against the wall. Have one of the
students do it for you.
serviceman - 03 Apr 2006 19:59 GMT
Hey Barry,
I'm not sure I follow you on using IIF;
What would the code look like?
Andy
>Instead of using an event, try putting the expression in the combobox's
>Default Value property (using IIF).
>
>By the way, don't bang your head against the wall. Have one of the
>students do it for you.

Signature
A $300 dollar picture tube will protect a 10 cent fuse by blowing first-
Murphy
Barry Gilbert - 03 Apr 2006 20:50 GMT
IIF is just like If/Then, except that it can be used on a single line,
which you'd need for a control's property. In the combobox's Default
Value property enter the following:
IIF(IsNull(Me.RQSTED_RANK),Me.Combo55 = DLookup("BELT_RANK",
"STUDENTS", "STUDENT_ID=" & Me.STUDENT_ID) + 1)
Check IIF in the online help to see how this works.