how to

carash77ash

Registered User.
Local time
Today, 23:44
Joined
Jan 13, 2006
Messages
81
Thanks for looking

I have a main form [quotefrm] and 6 subforms one on each page of a tab control.
there is an option box [arrayoption]. When the user selects the amount of arrays they want to quote, the pages corresponding to the selction is displayed. eg if the quote is for 3 arrays then subform array1,array2 and array3 is displayed. (easy enough)

The problem i am having is that after a record is saved, if the user returns to that record the option box has returned to showing only one array. (i have not set a default). though the information is not lost, i want the records to open showing the amount of arrays quoted on (in the option box) and the pages/subforms also showing in correctly.

i have tried to do this by using athe following code.

Private Sub Form_Load()
Dim ctl As OptionGroup
Set ctl = Me!arrayoption
Select Case arrayoption


Case 1
If Not IsNull(Me!ARRAY5FORM![ProductID]) Then
ctl.Value = 6

Me.array1.Visible = True
Me.array2.Visible = True
Me.array3.Visible = True
Me.array4.Visible = True
Me.array5.Visible = True
Me.array6.Visible = True
End If

Case 2
If Not IsNull(Me!ARRAY5FORM![ProductID]) Then
ctl.Value = 5
Me.array1.Visible = True
Me.array2.Visible = True
Me.array3.Visible = True
Me.array4.Visible = True
Me.array5.Visible = True
Me.array6.Visible = False
End If

Case 3
If Not IsNull(Me!ARRAY4FORM![ProductID]) Then
ctl.Value.Value = 4
Me.array1.Visible = True
Me.array2.Visible = True
Me.array3.Visible = True
Me.array4.Visible = True
Me.array5.Visible = False
Me.array6.Visible = False
End If

Case 4
If Not IsNull(Me!ARRAY3FORM![ProductID]) Then
ctl.Value = 3
Me.array1.Visible = True
Me.array2.Visible = True
Me.array3.Visible = True
Me.array4.Visible = False
Me.array5.Visible = False
Me.array6.Visible = False
End If

Case 5
If Not IsNull(Me!ARRAY2FORM![ProductID]) Then
ctl.Value = 2
Me.array1.Visible = True
Me.array2.Visible = True
Me.array3.Visible = False
Me.array4.Visible = False
Me.array5.Visible = False
Me.array6.Visible = False
End If

Case 6
Me.arrayoption.Value = 1
Me.array1.Visible = True
Me.array2.Visible = False
Me.array3.Visible = False
Me.array4.Visible = False
Me.array5.Visible = False
Me.array6.Visible = False

End Select

End Sub

obviously it is not working.
Any help will be much appreciated.
Regards
Carash77ash
 

Users who are viewing this thread

Back
Top Bottom