Yet another CPT-3 thread, VBA trouble this time. Watch

xeonman9000
Badges: 1
Rep:
?
#1
Report Thread starter 12 years ago
#1
Hi, In my Bookings form, I use a lookup to choose a customer ID from the Customers table. I then inserted a text box which I want to automatically display the Customer's name. I am using the following code in the OnClick box of the ID lookup box;

PHP Code:
If Me.Customer_ID.Value "0" Then
me
.customer_text.Value "Choose a customer ID."
Else
me.customer_text.Value tbl_CUSTOMERS.Customer_Name.Value
End 
If 
But I am not sure what variable name to use for the Customer Name field in the Customers table.
My tables are;
tbl CUSTOMERS
tbl BOOKINGS

My forms are;
frm CUSTOMERS
frm BOOKINGS

I don't really get this whole me., .value, .text, variable name stuff that VBA uses.
Thanks for any help.
0
quote
reply
Manalishi
Badges: 11
Rep:
?
#2
Report 12 years ago
#2
Is this is in excel or access? I'm presuming the latter...but if its the former I may be able to help...
0
quote
reply
xeonman9000
Badges: 1
Rep:
?
#3
Report Thread starter 12 years ago
#3
It's access (oh joy!).
0
quote
reply
X

Quick Reply

Attached files
Write a reply...
Reply
new posts
Latest
My Feed

See more of what you like on
The Student Room

You can personalise what you see on TSR. Tell us a little about yourself to get started.

Personalise

University open days

  • University of Lincoln
    Mini Open Day at the Brayford Campus Undergraduate
    Wed, 19 Dec '18
  • University of East Anglia
    UEA Mini Open Day Undergraduate
    Fri, 4 Jan '19
  • Bournemouth University
    Undergraduate Mini Open Day Undergraduate
    Wed, 9 Jan '19

Were you ever put in isolation at school?

Yes (233)
27.51%
No (614)
72.49%

Watched Threads

View All