cynapattery
Registered User.
- Local time
- Today, 13:56
- Joined
- Jul 9, 2013
- Messages
- 28
How to automatically populate the bound text box with data from a table for a specific entry.
this is the code I wrote
Private Sub ListBox_DblClick(Cancel As Integer)
Dim ListBoxSel As String
ListBoxSel = Me.ListBox.Value
Call proc_Update_TxtBoxes(Me.ListBox.Value)
DoCmd.Close
End Sub
Private Sub proc_Update_TxtBoxes(ListBoxSel)
Dim db As Database
Dim rs1 As DAO.Recordset
Dim strsql As String
Set db = CurrentDb
MsgBox ListBoxSel
strsql = "Select Website from Handler_contact where Haendlername = " & ListBoxSel
Set db = CurrentDb
Set rs1 = db.OpenRecordset(strsql)
'how do I get the bound textboxes with data from database?
Set rs1 = Nothing
rs1.Close
End Sub
Please help
this is the code I wrote
Private Sub ListBox_DblClick(Cancel As Integer)
Dim ListBoxSel As String
ListBoxSel = Me.ListBox.Value
Call proc_Update_TxtBoxes(Me.ListBox.Value)
DoCmd.Close
End Sub
Private Sub proc_Update_TxtBoxes(ListBoxSel)
Dim db As Database
Dim rs1 As DAO.Recordset
Dim strsql As String
Set db = CurrentDb
MsgBox ListBoxSel
strsql = "Select Website from Handler_contact where Haendlername = " & ListBoxSel
Set db = CurrentDb
Set rs1 = db.OpenRecordset(strsql)
'how do I get the bound textboxes with data from database?
Set rs1 = Nothing
rs1.Close
End Sub
Please help