importing

T

Terry

I have two access databases can I import them together? If I can how do I do
that? I'm new to access and any help will be greatly appreciated. Thanks in
advance.
 
J

John W. Vinson

I have two access databases can I import them together? If I can how do I do
that? I'm new to access and any help will be greatly appreciated. Thanks in
advance.

You can use File... Get External Data... Import to import objects such as
tables, forms, reports, etc.

If you have tables in both databases with data which needs to be merged into
one table, it might be easy - import the table and run an Append query; it
might be tricky, if you have Autonumber fields which may or may not be
duplicated between tables; it might be a nightmare, if there are duplicate and
near-duplicate and maybe-or-maybe-not duplicate records that must be resolved.
It all depends on the nature of the data and the structures of your tables.

John W. Vinson [MVP]
 
T

Terry

The second database doesn't have any data in it. It is just the program with
different forms and reports that I don't want to redo. I would like to add
them to the first database.
 
J

John W. Vinson

The second database doesn't have any data in it. It is just the program with
different forms and reports that I don't want to redo. I would like to add
them to the first database.

Then you can open the first database and use File... Get External Data...
Import. Import the forms and reports and any Queries or Modules or Macros that
they use.

You may need to open them in design mode and change their Recordsource
properties, and/or the details of the query, if the table or fieldnames in the
two databases don't match.

John W. Vinson [MVP]
 
T

Terry

Thank you John I have another question. How do I print a certain report. I
would like to have a parameter value come up and you enter the record number
but I can't seem to get this to work. If you could help I would greatly
appreciate it. Thanks
 
J

John W. Vinson

Thank you John I have another question. How do I print a certain report. I
would like to have a parameter value come up and you enter the record number
but I can't seem to get this to work. If you could help I would greatly
appreciate it. Thanks

Use a Parameter Query as the Recordsource for the report. A Report doesn't
have a paramter; the query upon which it is based does.

If you could post a bit more information about what you have tried and in
what way it "doesn't work" we might be more able to help.

John W. Vinson [MVP]
 
T

Terry

When I click print record it will print all of the records. How do I set the
parameter query up?
 
J

John W. Vinson

When I click print record it will print all of the records. How do I set the
parameter query up?

Terry, you're there - you can see your computer - you know the nature of your
data. I cannot and do not.

You would set up the query using an appropriate paramter on the Criteria line,
and use that query as the Recordsource for the report (rather than using the
table as the recordsource). Your "print record" button would launch the
report.

What's appropriate in your case? I don't know, given my lack of knowledge of
your application.

John W. Vinson [MVP]
 
T

Terry

on the Criteria line I have [enterrecordnumber], but it still doesn't work.
It prints all the records in form view not the record view and the parameter
doesn't come up.
 
J

John W. Vinson

on the Criteria line I have [enterrecordnumber], but it still doesn't work.
It prints all the records in form view not the record view and the parameter
doesn't come up.

Terry... please.

Again...

I CANNOT SEE YOUR COMPUTER.

I don't know where you have the critera line - you haven't said.
I don't know what you're clicking to print - you haven't said.
I don't know even what it is you're printing - a Report (good)? the Form (bad
idea)? - you haven't said.

I would like to be able to help, but without more information I cannot.

John W. Vinson [MVP]
 
T

Terry

The criteria line is in my query made by using the wizard from the table, I'm
clicking the command button in my form to print the report. I'm printing a
report.

John W. Vinson said:
on the Criteria line I have [enterrecordnumber], but it still doesn't work.
It prints all the records in form view not the record view and the parameter
doesn't come up.

Terry... please.

Again...

I CANNOT SEE YOUR COMPUTER.

I don't know where you have the critera line - you haven't said.
I don't know what you're clicking to print - you haven't said.
I don't know even what it is you're printing - a Report (good)? the Form (bad
idea)? - you haven't said.

I would like to be able to help, but without more information I cannot.

John W. Vinson [MVP]
 
J

John W. Vinson

The criteria line is in my query made by using the wizard from the table, I'm
clicking the command button in my form to print the report. I'm printing a
report.

Please open the Query in design view. On the menu, choose View... SQL. Copy
and paste the SQL code to a message here.

Also open the form in design view. Click the command button and view its
Properties. On the Events tab find the Click event; mouseclick the ... icon by
it to open the VBA editor; copy and paste the code to a message here.


John W. Vinson [MVP]
 
T

Terry

Sorry I didn't get right back. Had a emergency. Here is the information you
asked for. Thanks for your help.

SELECT SWTEST.ID
FROM SWTEST
WHERE (((SWTEST.ID)=[enter record number]));



Option Compare Database

Private Sub Command92_Click()
On Error GoTo Err_Command92_Click


DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.PrintOut acSelection

Exit_Command92_Click:
Exit Sub

Err_Command92_Click:
MsgBox Err.Description
Resume Exit_Command92_Click

End Sub
 
J

John W. Vinson

Sorry I didn't get right back. Had a emergency. Here is the information you
asked for. Thanks for your help.

SELECT SWTEST.ID
FROM SWTEST
WHERE (((SWTEST.ID)=[enter record number]));

This query will return the ID from your table - AND NOTHING ELSE.

If you want the report to print any fields other than the ID, open this query
in design view and add the fields that you want to see to the query grid. The
SQL will be

SELECT SWTEST.ID, SWTEST.thisfield, SWTEST.thatfield
FROM SWTEST
WHERE ... <as above>


Use this stored query as the Recordsource property of your report. I suspect
that currently the report is currently based on the entire table, not on the
query.
Option Compare Database

Private Sub Command92_Click()
On Error GoTo Err_Command92_Click


DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.PrintOut acSelection

Exit_Command92_Click:
Exit Sub

Err_Command92_Click:
MsgBox Err.Description
Resume Exit_Command92_Click

End Sub

UGLY old wizard code... don't know why this was never upgraded, but the wizard
is using Access 95 syntax!

Replace this with

Private Sub Command92_Click()
On Error GoTo Err_Command92_Click

Dim strReport As String

strReport = "EnterNameOfYourReportHere"
DoCmd.OpenReport strReport, acViewPreview

Exit_Command92_Click:
Exit Sub

Err_Command92_Click:
MsgBox Err.Description
Resume Exit_Command92_Click

End Sub


You can use acViewNormal if you want the report to print immediately rather
than opening in Preview mode.
 
T

Terry

John,

I made the changes but it still doesn't as me for the record number. This
is my query. SELECT SWTEST.[Record Number], SWTEST.[Sw Version:],
SWTEST.[Tester:], SWTEST.[Reviewed:], SWTEST.[Date:], SWTEST.[Installation
Runs OK], SWTEST.[Program comes up after install], SWTEST.[Main screen comes
onto the display], SWTEST.[Setup selections are stored], SWTEST.[Setup
selections to perform their functions], SWTEST.[Show ECG waves when
selected], SWTEST.[Store ECGs when selected], SWTEST.[Gain settings],
SWTEST.[Lead selections], SWTEST.[Sweep Speed display modes],
SWTEST.[Algorithm selections (filters)], SWTEST.[Retrieve Data Selected],
SWTEST.[Grid on/off], SWTEST.[Condense/non condensed displays], SWTEST.[ECG'S
as Applicable], SWTEST.[Summary as applicable (Screen Test OK)],
SWTEST.[Measurement cursors], SWTEST.[Demographics editing],
SWTEST.[Batch/Telecom], SWTEST.[Batch list editing: adding, clearing,
subtracting and listing fu], SWTEST.[Can check just files], SWTEST.[Database
Deletions], SWTEST.[Menu and Button Coordination], SWTEST.[Mode changes
(Retrieve to ECG, etc], SWTEST.Installed, SWTEST.[Proper Statement for any
test ECG], SWTEST.[Misc:], SWTEST.[Read in OK], SWTEST.[Auto analysis of test
mark R Waves], SWTEST.[Change Beat Code], SWTEST.[Delete Beat],
SWTEST.[Special Test this rev], SWTEST.[Report Printing:], SWTEST.[Holter:],
SWTEST.[Copy Drive to Drive], SWTEST.[Test Date:]
FROM SWTEST
WHERE (((SWTEST.[Record Number])=[enterrecordnumber]));

The code is

Private Sub Command92_Click()
On Error GoTo Err_Command92_Click

Dim strReport As String

strReport = "STF Report"
DoCmd.OpenReport strReport, acViewPreview

Exit_Command92_Click:
Exit Sub

Err_Command92_Click:
MsgBox Err.Description
Resume Exit_Command92_Click

End Sub
Did I put something in wrong. Thank you so much for your help.

Terry


John W. Vinson said:
Sorry I didn't get right back. Had a emergency. Here is the information you
asked for. Thanks for your help.

SELECT SWTEST.ID
FROM SWTEST
WHERE (((SWTEST.ID)=[enter record number]));

This query will return the ID from your table - AND NOTHING ELSE.

If you want the report to print any fields other than the ID, open this query
in design view and add the fields that you want to see to the query grid. The
SQL will be

SELECT SWTEST.ID, SWTEST.thisfield, SWTEST.thatfield
FROM SWTEST
WHERE ... <as above>


Use this stored query as the Recordsource property of your report. I suspect
that currently the report is currently based on the entire table, not on the
query.
Option Compare Database

Private Sub Command92_Click()
On Error GoTo Err_Command92_Click


DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.PrintOut acSelection

Exit_Command92_Click:
Exit Sub

Err_Command92_Click:
MsgBox Err.Description
Resume Exit_Command92_Click

End Sub

UGLY old wizard code... don't know why this was never upgraded, but the wizard
is using Access 95 syntax!

Replace this with

Private Sub Command92_Click()
On Error GoTo Err_Command92_Click

Dim strReport As String

strReport = "EnterNameOfYourReportHere"
DoCmd.OpenReport strReport, acViewPreview

Exit_Command92_Click:
Exit Sub

Err_Command92_Click:
MsgBox Err.Description
Resume Exit_Command92_Click

End Sub


You can use acViewNormal if you want the report to print immediately rather
than opening in Preview mode.
 
J

John W. Vinson

I made the changes but it still doesn't as[k] me for the record number.

What is the Recordsource property of the report? It sounds like you created
the query but did not use it in the report.
 
T

Terry

I created my report from the table of the form. I'm not sure what the record
source property is. How can I find out?

John W. Vinson said:
I made the changes but it still doesn't as[k] me for the record number.

What is the Recordsource property of the report? It sounds like you created
the query but did not use it in the report.
 
J

John W. Vinson

I created my report from the table of the form. I'm not sure what the record
source property is. How can I find out?

Open the Report in design view. View its Properties. Look at the first row on
the Data tab.

Change this from the name of the table to the name of your query and you will
then be displaying the data in the query (what you do want) rather than all
the records in the table (what you're now asking for).
 
T

Terry

Thank you So Much. It works great!!!!! I really appreciate all the time you
took with me. Have a great day! Thank you again
 

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