Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

form control type

Status
Not open for further replies.

ciarra41

Technical User
Sep 11, 2006
116
US
Hi,
I currently use the control value 107 to update a table from a select box in a form but now I need to change it to a combo box, what is the control type value for a combo box?

Dim ctl As Control, intValuesFound As Boolean
intFrmClose = False
intValuesFound = False

For Each ctl In Me.Form
If ctl.ControlType = 107 Then
If Not IsNull(ctl.Value) Then
intValuesFound = True
 
107 is acOptionGroup.
Use acComboBox (111).

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
The ControlType property setting is an intrinsic constant that specifies the control type.
Constant Control
acBoundObjectFrame Bound object frame
acCheckBox Check box
acComboBox Combo box
acCommandButton Command button
acCustomControl ActiveX (custom) control
acImage Image
acLabel Label
acLine Line
acListBox List box
acObjectFrame Unbound object frame or chart
acOptionButton Option button
acOptionGroup Option group
acPage Page
acPageBreak Page break
acRectangle Rectangle
acSubform Subform/subreport
acTabCtl Tab
acTextBox Text box
acToggleButton Toggle button
 
still no luck, here's the whole thing.

Private Sub CmdFormClose_Click()
Dim ctl As Control, intValuesFound As Boolean
intFrmClose = True
intValuesFound = False

For Each ctl In Me.Form
If ctl.ControlType = 111 Then
If Not IsNull(ctl.Value) Then
intValuesFound = True
End If
End If
Next

If intValuesFound Then
If MsgBox("Do you wish to Save the current selections", vbYesNo, "SAVE DATA BEFORE CLOSING FORM") = vbYes Then
Save_Current_Data
Else
DoCmd.Close
End If
Else
DoCmd.Close
End If

End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top