Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBA Help

Status
Not open for further replies.
Jun 26, 2001
41
US
Hey Everyone,

I am getting back into the programming game and am stuck.

I have a form and want to into a value into a text box which goes and looks for this in a table, if found then it will display the values in the appropriate text boxes on form. If not found allows the user to enter in the appropriate data.

Here is part my code.


If DLookup("[ServiceTag]", "Computers", "[servicetag] = Forms![Setup_Form]![ServiceTag]") Then

'Not too sure how I write code to tell the program to link the field in the table to the text box on the form.

Computers.Make = Forms!Setup_Form!Make
Computers.Model = Forms!Setup_Form!Model
Computers.Partitions = Forms!Setup_Form!Partitions
Computers.CPU = Forms!Setup_Form!CPU
Computers.RAM = Forms!Setup_Form!RAM
Computers.HDSize = Forms!Setup_Form!HDSize
Computers.ServiceCode = Forms!Setup_Form!ServiceCode

Thank you for any help that you people can offer,

Byron
 
You need the runtime value for

"[servicetag] = Forms![Setup_Form]![ServiceTag]")

MyCrit = "[servicetag] = " & Forms![Setup_Form]![ServiceTag]

Rollie E
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top