Need help

G

Guest

I have a database with several tables, querries, forms and reports. I want to
be able to create a table and fill in information from automatically another
table. The database contains gage numbers, descriptions, dates, reference
standard check box. What I want is to have information I enter on one form
automatically entered into another table. The indicator to have this
information copied would be the check box. Can anyone help me with this? Is
this possible? Any help would be great
 
J

Joseph Meehan

Ron said:
I have a database with several tables, querries, forms and reports. I
want to be able to create a table and fill in information from
automatically another table. The database contains gage numbers,
descriptions, dates, reference standard check box. What I want is to
have information I enter on one form automatically entered into
another table. The indicator to have this information copied would be
the check box. Can anyone help me with this? Is this possible? Any
help would be great

I am not sure exactly where you are going, but it sounds like you may be
trying to make a mistake. If you have the data in one table you would
seldom want to put that same information in another table. You would want
to reference it.

Does that make sense?
 
A

Arvin Meyer

You can use the AddNew property of a Recordset to add a record into a table
which is not the table bound to the form. You can also use a query. I
usually use the recordset because it's self contained in the code and
appending a single record takes practically no cpu time. A sample snippet of
code might look like this (air code):

Sub Form_AfterUpdate()
If Me.chkWhatever = True Then
Dim db As DAO.Database
Dim rst As DAO.Recordset

Set db = CurrentDB
Set rst = db.OpenRecordset("The Second Table", dbOpenDynaset)
With rst
.AddNew
!Field1 = Me.txtControl1
!Field2 = Me.txtControl2
!Field3 = Me.txtControl3 'etc.
.Update
End With
End If
Exit_Here:
On Error Resume Next
rst.Close
Set rst = Nothing
Set db = Nothing
Exit Sub

End Sub

Add some error handling and your done.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access Downloads
http://www.datastrat.com
http://www.mvps.org/access
 
A

Arvin Meyer

I am not sure exactly where you are going, but it sounds like you may be
trying to make a mistake. If you have the data in one table you would
seldom want to put that same information in another table. You would want
to reference it.

Does that make sense?

Generally, you are correct. If the data is in one place, you can query it.
Depending upon the usage though, you may need to build temporary sets of
data to run a report, or pull a set of data to edit it and later discard the
changes, or create a history of changes. I happen to be building one now
which uses pieces of tables in multiple tables. The main data is still
referred (joined) to when most of the matching data is used, but I am using
4 or 5 of the fields in each of the tables. While I could use just a key, it
would make it more difficult to select and sort records which are to be
included in a set.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access Downloads
http://www.datastrat.com
http://www.mvps.org/access
 
G

Guest

This is great information but it wil not help me. What I am trying to do is
as follows.
I have a form that I use ti enter data into. On this form there is fields
that collect data. I have the form that when I enter the number of the gage,
it pulls the remaining information from another table. I want to be able to
enter a different number on this form and have it pull the information for
that number. What I keep getting is it wants to enter the numbers for all
records. My databse is a calibration log. I use tio track inspection gages.
 
A

Arvin Meyer

Hint: Try using the combo box wizard to build a combo box that looks up
records (the third option in the list). That combo will not be bound to any
table, but needs to have one unique field in common with the table to do the
lookups.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access Downloads
http://www.datastrat.com
http://www.mvps.org/access
 

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

Top