Experts Exchange connects you with the people and services you need so you can get back to work.
Private Sub Form_Open(Cancel as Integer)
On Error Goto ProcError
Dim rs as DAO.Recordset
Dim intfld as integer
Set rs = me.recordsetclone
for intFld = 2 to rs.fields.count-1
me.controls("lbl_" & intFld).Caption = rs.fields(intFld).Name
me.controls("txt_" & intFld).ControlSource = "[" & rs.Fields(intFld).Name & "]"
On Error Resume Next
set rs = nothing
msgbox err.number & vbcrlf & err.description, , "Form_Open Format Controls"
debug.print "Form_Open Format Controls", err.number, err.description
debug.print "rs.Fields.count = ";rs.fields.count
debug.print "form.controls.count = ";me.controls.count
Open in new window
Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.
Dim pSQL As String
pSQL = "SELECT * FROM Staging_Table ORDER BY Staging_Table.Tech_Name"
Me.dataAvailabilitySubform.SourceObject = "Query.qryStagingTable"
Me.dataAvailabilitySubform.Form.RecordSource = pSQL
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.
Please enter a first name
Please enter a last name
Must be at least 4 characters long.
Join and Comment
From novice to tech pro — start learning today.
Premium members can enroll in this course at no extra cost.