When the user opens a file from a common dialog box i want the project to update the text boxes on my form with data from the dbf file they select. how do i do this?
please help.
thanks in advance.
Printable View
When the user opens a file from a common dialog box i want the project to update the text boxes on my form with data from the dbf file they select. how do i do this?
please help.
thanks in advance.
OK so you have bound the control to the ADO, through the Datasource. And in the Datafield property you have set the table. The textboxes were set to the fields right?
So under the common dialog click (change) event procedure, do you have the code telling it to change?
Lee
What is the code to make it change?
If you have them bound, and ready to go the text should display when the click event is fired. If the text does not change then refresh the form.
Here is the code for my open file dialog:
Private Sub Open_Click(Index As Integer)
On Error GoTo ErrHandler
'set filters
CommonDialog1.Filter = "DBF (*.dbf)|*.dbf"
'display file open box
CommonDialog1.ShowOpen
Data1.DatabaseName = CommonDialog1.filename 'sets database as selected file
Text2.DataField = "MARKET" 'this is the name of the field i want to pull
frmGlobal.Refresh
ErrHandler:
Exit Sub
End Sub
In the options for text2 the datasource is set as data1.
when they open the file the value in "MARKET" does not show up in the text box.
Under the field "Market" I am assuming there are multiple entries?
It looks to me that you need to move the recordpointer to the first entry in the field, (or desired entry).
.movefirst
It dosen't know where to look, do you know what I mean?
...But what do I know!
Lee