Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / July 2007

Tip: Looking for answers? Try searching our database.

How to reference to a table?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
EmilH - 09 Jul 2007 07:52 GMT
Hi.

I have one form that is linked to one of 3 tables. All data is successfully
entered to that table when I press Add button on my form. Now I want one
field to be inserted to another table as well. Here is the line of code, but
it's incorrect.

Tables!Employment_Data!Employment_Name = Line_1 & " " & Line_2 & " " & Line_3

Can you help me with it? How to make a field to be entered into more than
one tables?

Thanks!
Scott McDaniel - 09 Jul 2007 11:32 GMT
>Hi.
>
[quoted text clipped - 7 lines]
>Can you help me with it? How to make a field to be entered into more than
>one tables?

You could include the second table in your form's Recordsource, then you'd reference it like this:

Me.Employment_Name = Line_1 & " " & Line_2 & " " & Line_3

However, this often doesn't work out, since you may not be able to include that table in your recordsource. If that's
the case, then you'd need to use an Insert statement:

Currentdb.Execute "INSERT INTO Employment_Name(Employment_Name) VALUES('" & Line_1 & " " & Line_2 & " " & Line_3 &")"

>Thanks!

Scott McDaniel
scott@takemeout_infotrakker.com
www.infotrakker.com
EmilH - 09 Jul 2007 12:04 GMT
Hi, Scott.

Thank you very much for response! The second solution works fine. But now I
have to find out how to point current database to the Database object. When I
specify the path to it, it works fine, but users will not open the code each
time when the location of the file changes and will not update its path. How
can I specify it?

Dim db = Database
db = ???

It seems to be easy, but I'm new to VBA. Sorry.

> >Hi.
> >
[quoted text clipped - 22 lines]
> scott@takemeout_infotrakker.com
> www.infotrakker.com
EmilH - 09 Jul 2007 12:52 GMT
Never mind, Scott. I fixed it. Thank you!

> >Hi.
> >
[quoted text clipped - 22 lines]
> scott@takemeout_infotrakker.com
> www.infotrakker.com
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.