A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

How to auto fill info. from a table to a form?



 
 
Thread Tools Display Modes
  #1  
Old August 31st, 2004, 02:45 PM
pennylj
external usenet poster
 
Posts: n/a
Default How to auto fill info. from a table to a form?

If I have a table with customers information and want to automatically fill
in some of the info. on an order form, how do I tell access to auto fill that
info?
  #2  
Old August 31st, 2004, 07:27 PM
Frank Stone
external usenet poster
 
Posts: n/a
Default

here is a sub i used to auto fill 2 other text boxes when
some enter a PO in the PO txtbox. has quallifiers too.
Maybe you can use it as a template or maybe get some ideas.
delete all of my field names and tables and add in yours.
It uses the dLookup function. syntax:
dlookup("[field1]","table","[field2]='" & me.control & "'"

Private Sub txtPOonPackSlip_BeforeUpdate(Cancel As Integer)
Dim txtPOonPackSlip As Variant

If (IsNull(DLookup
("[POI_Reference]", "POI", "[POI_PurchOrderID]='" & Me!
txtPOonPackSlip & "' and [POI_Reference] = '" & Me!
txtItemID & "'"))) Then
MsgBox ("The ItemID entered is not on the PO
entered. Check your Input.")
Exit Sub
Else
Me!txtVendorName = DLookup
("[POM_PayName]", "POM", "[POM_PurchOrderID] ='" & Me!
txtPOonPackSlip & "'")
Me!txtBuyer = DLookup
("[POM_Buyer]", "POM", "[POM_PurchOrderID] = '" & Me!
txtPOonPackSlip & "'")
End If
End Sub

-----Original Message-----
If I have a table with customers information and want to

automatically fill
in some of the info. on an order form, how do I tell

access to auto fill that
info?
.

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy Displayed info from a Form to Table Randy Lucero Using Forms 0 August 12th, 2004 02:22 PM
Complicated Databse w/many relationships Søren Database Design 7 July 13th, 2004 05:41 AM
Newbie? Do I use Report or Query John Egan New Users 11 June 28th, 2004 08:31 PM
How do I bind a control on a form to a different table than the form is bound to? Mark Gonyea Using Forms 2 June 4th, 2004 09:01 PM


All times are GMT +1. The time now is 03:28 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.