N
nath
Hello
I am accessing an access database from excel and using a
table in the database tbl_candidates to populate the label
captions on a userform, this works great. However, i have
one field ethnicity that i would like to populate from a
table tbl_ethnicity, this i have done in the database, but
i need to know how to work out :
a) Whether a field has a value list attached as outlined
above
b) how to work out the rowsource itself
The code i have used is below
Private Sub UserForm_Activate()
Dim flag As Boolean
flag = False
fname = "Z:\Misc\unmatch.mdb"
Set wrkjet = CreateWorkspace("", "admin", "", dbUseJet)
Set dbs = wrkjet.OpenDatabase(fname, True)
sql = "Select * from [tbl_candidates];"
Set rst = dbs.OpenRecordset(sql)
For h = 0 To rst.Fields.Count - 1
fld_name = rst.Fields(h).Name
UserForm1("Label" & h).Caption = fld_name
flag = False
Next h
Can anyone help
TIA
Nathan
I am accessing an access database from excel and using a
table in the database tbl_candidates to populate the label
captions on a userform, this works great. However, i have
one field ethnicity that i would like to populate from a
table tbl_ethnicity, this i have done in the database, but
i need to know how to work out :
a) Whether a field has a value list attached as outlined
above
b) how to work out the rowsource itself
The code i have used is below
Private Sub UserForm_Activate()
Dim flag As Boolean
flag = False
fname = "Z:\Misc\unmatch.mdb"
Set wrkjet = CreateWorkspace("", "admin", "", dbUseJet)
Set dbs = wrkjet.OpenDatabase(fname, True)
sql = "Select * from [tbl_candidates];"
Set rst = dbs.OpenRecordset(sql)
For h = 0 To rst.Fields.Count - 1
fld_name = rst.Fields(h).Name
UserForm1("Label" & h).Caption = fld_name
flag = False
Next h
Can anyone help
TIA
Nathan