hidden to viable

eddcole

Registered User.
Local time
Today, 05:19
Joined
Jan 5, 2016
Messages
18
hi guys,

I have created a form that does not show other fields until a certain field is updated (after update). you can only fill these out once the first field is used. the first field is a combobox.

My dilemma is that when I recall the form everything is now hidden again and I have to reuse the combobox to see the rest of the data.

Is there any way round this so I see all the data when I recall the form.

Cheers in advance

edd
 
put the value of your combobox to a Tempvars collection:

on your form's load event, check it tempvars exists and set your combobox to it:

Code:
private sub form_load()
    If IsNull(Tempvars("anyName"))
        ' if your combobox returns a text
        Tempvars.Add "anyName", ""
       ' if numeric comment the above line and uncomment the ff line
       ' Tempvars.Add "anyName", 0
    Else
        Me.yourCombobox = Tempvars("anyName")
    End If
end sub
and on your forms unload event:

Code:
private sub form_unload()
    'if your combobox is text
    Tempvars("anyName") = Me.yourCombobox.Value & ""
    'if numeric
    Tempvars("anyName") = Nz(Me.yourCombobox, 0)
end Sub
 

Users who are viewing this thread

Back
Top Bottom