Solved How to copy list box data to other text box in same form in access (1 Viewer)

hrdpgajjar

Registered User.
Local time
Today, 10:24
Joined
Sep 24, 2019
Messages
51
Hi all,
I've a material supplied entry form (and a table with same name also) which has two text boxes i.e Registration number and client name. Another table is "Data Table" where some other details about the client is saved (like address, pin code etc.).

- Now I have created a search query combined to Registration number text box to check weather i have entered client details in "Data Table" or not. If data found then it will displayed in the list box.

Now I want to create a "Copy" Button which copies two fields (i.e. Registration Number and Client Name) in the current form from a list box to save time entering details twice.

How can I create a copy button to copy data from a list box to text boxes...

Help appreciated

Thanks !!!
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 12:54
Joined
May 7, 2009
Messages
19,239
what are the columns of your listbox,

private sub button1_click()
If Me!Listbox1.ListIndex > -1 Then
Me!txtRegistraton = Me!Listbox1
Me!txtClientName = Me!Listbox1.Column(1)
End If
End Sub
 

hrdpgajjar

Registered User.
Local time
Today, 10:24
Joined
Sep 24, 2019
Messages
51
what are the columns of your listbox,

private sub button1_click()
If Me!Listbox1.ListIndex > -1 Then
Me!txtRegistraton = Me!Listbox1
Me!txtClientName = Me!Listbox1.Column(1)
End If
End Sub
I have two columns in list box "Registration Number" and "Client Name". And yes it serve my purpose very well. Works like a charm!!! Thanks for the prompt reply
 
Last edited:

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 12:54
Joined
May 7, 2009
Messages
19,239
you're welcome :)
 

Users who are viewing this thread

Top Bottom