Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.
Option Compare Database Private Sub Command0_Click() BuildValueList ("qryAll") End Sub Public Function BuildValueList(TableName As String) On Error GoTo myerror Dim FinalString As String Dim db As Database Dim rs As Recordset Dim myfield As Field Set db = CurrentDb Set rs = db.OpenRecordset("Select * from " & TableName & " where 1 = 2;", dbOpenDynaset, dbSeeChanges) For Each myfield In rs.Fields FinalString = FinalString & Nz(myfield.Properties("Caption"), "no caption") & ";" Next myfield Me.lstFields.RowSource = FinalString Exit Function myerror: If Err.Number = 3270 Then 'no existing caption FinalString = FinalString & myfield.Name & ";" & "no caption" & ";" Resume Next End If End Function
|Need Help,, i m beginner in vba,, i'm writing a code for exporting the data from Userform to Access Database||13||65|
|Import data to Access from Excel predefining key||8||34|
|Generate report pulling data (links) from three tables||31||30|
|Modifying a MSAccess table from another MSAccess DB||8||38|
Join the community of 500,000 technology professionals and ask your questions.
Connect with top rated Experts
20 Experts available now in Live!