Select Record From Subform

xhoz

New member
Local time
Today, 17:08
Joined
Sep 13, 2004
Messages
8
With my form i go thru a listbox ask for the records from a customer name...
then in my subform i can see the filtered records...

But you can select a record by clicking on it...but can i also with a button get for example that customer-ID in a textfield by clicking on a button?
(i'm dutch so sorry for my english :rolleyes: )

can someone make a little example for me or give me some vba-code ?

thx Xhoz
 
If I am reading your questions correctly... And assuming your listbox contains the CustomerID for example in Column(0) then


Code:
Private Sub Command1_Click()

Me.Text1 = Me.Listbox.Column(0)

End Sub
 
re:

i want to click on a record in my subform...
and with a button move for example the (name or street or areacode,...) of the selected record to a field...
like a kind of dategrid...

i have to filter on areacode
then select a customer on the subform
and make a invoice or something on it....
 
xhoz said:
i want to click on a record in my subform...
and with a button move for example the (name or street or areacode,...) of the selected record to a field...
like a kind of dategrid...

i have to filter on areacode
then select a customer on the subform
and make a invoice or something on it....

OK..

I am not too sure why you want to do this... But if you need to print an invoice based on the current record just set the report's recordsource to something like

"Select * FROM mytable WHERE CustID = [Screen].[ActiveForm]![MyTextBox]"

Then it will only print out records where the customer ID matches the forms active customer id.
 
re2:

on the attached screenshot you will understand my question...yeah i can't write very good english :)

I have selected a row in the subform after filtring on cellphonenumber...but when i wanne use the value of field "registratienummer"(registrationnumber) from the selected row... and place that value to a field....

i can use that value on the field to make my invoice...
do you understand me or.... ?

thx xhoz
 

Attachments

  • probleme.JPG
    probleme.JPG
    90 KB · Views: 181
Private Sub Command1_Click()
Me.Text15 = Me.SubForm1!registrationumber
End Sub

like that?
 
Re3:

Yeah it works !!!! ;) ;) ;) ;)

thxxxxxxxxxxxxxxxxxxxxxxxxxxx!!!!!

i've been searching to this all the week :(

again thx!!!!!!!!!! :) :)
 

Users who are viewing this thread

Back
Top Bottom