|
-
Sep 22nd, 2000, 12:26 PM
#1
Thread Starter
Junior Member
When you run the project and open a dbf file with a commondialog box, it sets the data1 source (the databse file) to the file the user chose. How do i set up the bound text boxes to pull the data from the database when the user selects the file from the dialog box?
hope this question makes sense.
thanks in advance.
If you reach total enlightenment while drinking a beer, I bet it makes beer shoot out your nose.
VB5 Enterprise SP3
-
Sep 22nd, 2000, 12:36 PM
#2
Lively Member
If I understand your question correctly then just set the datasource of the textbox to the user choice.
text1.Datasource = data1 'User's choice
Hope this helps.
-
Sep 22nd, 2000, 12:48 PM
#3
_______
<?>
Code:
Private Sub Command2_Click()
'display the commondialog show open
CommonDialog1.InitDir = "C:\" 'set dir path
CommonDialog1.CancelError = True 'used in cancel code
CommonDialog1.Filter = "All files(*.*)|*.*" 'filter for all files
CommonDialog1.ShowOpen 'show files
Data1.Database = CommonDialog1.FileName
Text1.DataSource = Data1
Text1.DataField = "yourfield"
End Sub
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
-
Sep 22nd, 2000, 03:53 PM
#4
_______
<?>
If you want, zip your program and the database and send it to me and I will test it on VB6.
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
-
Sep 23rd, 2000, 10:09 PM
#5
You have to use 'Set' when you change the Datasource
Code:
Set Text1.DataSource = Data1
Try that!
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
|