I need more hel p please
This is not working well for me.
Because based on the control name if it is a check box and its value is True
I am updating Data in the table based on the value of Check box .
This is what I have
Sub CreateControlOnPage()
Dim frm As Form, ctl As Control
Dim iT, iL, iW, iH, iCW, iCL As Double
Dim rs As Recordset
Dim strSQL As String
strSQL = "SELECT tblReviewDesc.Description, tblReviewDesc.Level FROM
tblReviewDesc WHERE (((tblReviewDesc.Level) =" &
[Forms]![frmreviewselection]![TxtLevel] & ")) ORDER BY
tblReviewDesc.Description;"
Set rs = CurrentDb.OpenRecordset(strSQL, dbOpenSnapshot)
' DoCmd.OpenForm "frmReview", acDesign
Set frm = Forms!frmReview
strReviewString = ""
' Create a tab control on the new form.
iT = 0.3333
iL = 0.3333
iW = 1.2917
iH = 0.1667
iCW = 0.171
iCL = 1.6667
With rs
.MoveFirst
Do Until .EOF
Set ctl = CreateControl(frm.Name, acLabel, acDetail) ',
rs!ReviewofSystem)
ctl.Top = iT * 1440
ctl.Left = iL * 1440
ctl.Width = iW * 1440
ctl.Height = iH * 1440
ctl.Name = "Lbl" & rs!Description
ctl.Caption = rs!Description
ctl.FontBold = True
ctl.Visible = True
' Create a text box on the form, and specify that Page2 is
' the parent of the text box.
Set ctl = CreateControl(frm.Name, acCheckBox, acDetail) ',
rs!ReviewofSystem)
ctl.Top = iT * 1440
ctl.Left = iCL * 1440
ctl.Width = iCW * 1440
ctl.Name = rs!Description
ctl.Visible = True
iT = iT + 0.2084
.MoveNext
Loop
End With
DoCmd.SelectObject acForm, frm.Name
DoCmd.OpenForm frm.Name
End Sub
and I am doing an update to the Table this way
Dim ctl As Control
For Each ctl In Me.Controls
If TypeOf ctl Is CheckBox Then
If ctl.Value = True Then
strReviewString = strReviewString & ctl.Name & "(x)" & vbCrLf
Else
strReviewString = strReviewString & ctl.Name & "(-)" & vbCrLf
End If
End If
Next ctl
What is my second option here. Can I secure my code in all of the Program.
How can I do this without prompting the user to enter User Name or Password.
Thanks
Dib
Allen Browne said:
As you found, you cannot use CreateControl in an MDE.
You will need to create sufficient of each type of control for the maximum
you will ever need, and set the Visible property to True when you need them.
in
an giving
the