|
-
Aug 2nd, 1999, 01:03 PM
#1
Thread Starter
Addicted Member
I am entering data on a from to update an access database and for some fields I need to use a drop-down select from a different access table(eg area, industry) Can i do this with a combo? Is it possible to populate a combo text with data from an access table? Help please!!
-
Aug 2nd, 1999, 01:36 PM
#2
Addicted Member
May be this will help. Use a DBCombo box and bound it to Data1 control. Insert some textbox and bound them to Data2. I thinking you know how to use Data Control. Then place a button and apply this code.
Dim sql As String
Dim last As String
Dim db As Database
Dim dbr As Recordset
'I used last name because that is what my
'DBCombo box is populated with
last = DBCombo1.Text
sql = "select * from " & "member where lastname = '" & last & "';"
'Use this pwd if you database is password
'protected if not then just ("Database 'Path").
Set db = OpenDatabase _
("Database Path", False, False, "MS Access;pwd=Password of Database")
Set dbs = db.OpenRecordset(sql)
Do Until dbs.EOF
Data2.Refresh
Data2.RecordSource = sql
dbs.MoveNext
Loop
Data2.Refresh
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|