Database Driven User Forms

  • Thread starter Brandon J. Acquaviva
  • Start date
B

Brandon J. Acquaviva

I have a user form that will have OptionButtons added dynamically from
a database. That part is fine as I have this part working. Now i
need to know how to create an event handler that will change the
content of a text box (txtInfo) when the option buttons are clicked.
The value that will fill the textbox will be pupulated from the
database as well.


'************************************************************
' ADD THE OPTION BUTTONS

TopPos = 4
MaxWidth = 0 'Stores width of widest OptionButton
Do While Not objRS.EOF
Dim TempID As String
TempID = "Temp" & objRS("id_no")
If objRS("template_version") = 0 Then
strCaption = objRS("template_name")
Else
strCaption = objRS("template_name") & " - REV " &
objRS("template_version")
End If
Set optTemplates = Controls.Add("forms.OptionButton.1")
With optTemplates
.Width = 200
.Caption = strCaption
.Enabled = objRS("template_enabled")
.Height = 15
.Left = 8
.Top = TopPos
.AutoSize = True
.Accelerator = objRS("template_accelerator")
.Value = objRS("template_default")
End With
TopPos = TopPos + 15
objRS.MoveNext
Loop
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top