Retrieve data from a column in another table

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi, I have a SQL 2000 database which use access database as frontend. In the
sql 2000 db, there are two tables, one is clientinfo table, which contains
clientname and clientadd column and the other is orderinfo table which
contains clientname and orderdate column. I have four questions: 1). How
can I do so that the orderdate could be defaulted to current date? 2). What
should I do so that I could use a drop down box in orderinfo table to
retrieve the clientname in clientinfo table when I am entering client order
information.
 
Hi.
1). How
can I do so that the orderdate could be defaulted to current date?

Two choices:

1.) Use DEFAULT when defining the column in the table. See the SQL Server
BOL for more information on the syntax.

2.) Assign =Date() to the text box's Default Value Property in the form
that is bound to the query that uses the table as a data source.
2). What
should I do so that I could use a drop down box in orderinfo table to
retrieve the clientname in clientinfo table when I am entering client
order
information.

What you're asking for is called a lookup field, and it's available in
Access (Jet or ACE) tables, but not in SQL Server tables. However, data
should never be entered directly into the table, but in forms, where the
data can easily be handled and validated with the form's and control's
event's. Lookup fields cause untold headaches, and should never be used.
Please see the following Web page for more information:

http://www.mvps.org/access/lookupfields.htm

Instead, use a combo box on the form. The combo box wizard will build it
for you if you don't want to do it manually. It's easiest if one links to
the SQL Server tables beforehand.

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
Blog: http://DataDevilDog.BlogSpot.com
http://www.Access.QBuilt.com/html/expert_contributors2.html for contact
info.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top