Report based on an Input

J

John Calder

Hi

I run W2K and Access 2K

This is my 1st database. I have created a database that has the following
fields:

Date (formatted to date)
Time (formatted to time)
Crew (taken from another table)
Coil Number (formatted to text)
Edge Damage (formatted to memo box)
Bore Dents (formatted to memo box)
Comments (formatted to memo box)


What I would like is to create a report that I can type in a Coil Number and
the information for that coil number only is shown on the report. Can anyone
help?

Any help is much appreciated

John
 
D

Duane Hookom

Add a combo box to a form:
Name: cboCoilNumber
Control Source:
Row Source Type: table/query
Row Source: SELECT [Coil Number] FROM tblYourTable GROUP BY [Coil Number];
Limit To List: Yes
Column Count: 1
Bound Column: 1

Then use the command button wizard to add a button that opens your report.
Once the wizard has finished, view the code module created by the wizard and
modify it to look something like:

Dim strWhere as String
If Not IsNull(Me.cboCoilNumber) Then
strWhere = "[Coil Number]=""" & Me.cboCoilNumber & """"
End If
DoCmd.OpenReport, "rptYourReport", acPreview, , strWhere
 
J

John Calder

Thanks Duane

Sorry about the double posting I wasnt sure which area to put it in.

I will give it a go tommorrow and let you know how I went

Thanks Again

John


Duane Hookom said:
Add a combo box to a form:
Name: cboCoilNumber
Control Source:
Row Source Type: table/query
Row Source: SELECT [Coil Number] FROM tblYourTable GROUP BY [Coil Number];
Limit To List: Yes
Column Count: 1
Bound Column: 1

Then use the command button wizard to add a button that opens your report.
Once the wizard has finished, view the code module created by the wizard and
modify it to look something like:

Dim strWhere as String
If Not IsNull(Me.cboCoilNumber) Then
strWhere = "[Coil Number]=""" & Me.cboCoilNumber & """"
End If
DoCmd.OpenReport, "rptYourReport", acPreview, , strWhere

--
Duane Hookom
MS Access MVP

John Calder said:
Hi

I run W2K and Access 2K

This is my 1st database. I have created a database that has the following
fields:

Date (formatted to date)
Time (formatted to time)
Crew (taken from another table)
Coil Number (formatted to text)
Edge Damage (formatted to memo box)
Bore Dents (formatted to memo box)
Comments (formatted to memo box)


What I would like is to create a report that I can type in a Coil Number
and
the information for that coil number only is shown on the report. Can
anyone
help?

Any help is much appreciated

John
 
J

John Calder

Duane

I apologise if I have not explained things correctly. By adding a combo box
I get a list of all the coil numbers that are in the database and as there
will eventually be thousands of them this will not meet my needs. I would
like to just have a box that I can type in the required coil number and the
report will generate that number with all its associated data.

Also when I go to the Row Source and I select the three little dots it
automatically opens the query editor...is this correct?

As your instruction does not mention the query editor I am assuming I have
done something wrong.

As before all help is really appreciated

John


John Calder said:
Thanks Duane

Sorry about the double posting I wasnt sure which area to put it in.

I will give it a go tommorrow and let you know how I went

Thanks Again

John


Duane Hookom said:
Add a combo box to a form:
Name: cboCoilNumber
Control Source:
Row Source Type: table/query
Row Source: SELECT [Coil Number] FROM tblYourTable GROUP BY [Coil Number];
Limit To List: Yes
Column Count: 1
Bound Column: 1

Then use the command button wizard to add a button that opens your report.
Once the wizard has finished, view the code module created by the wizard and
modify it to look something like:

Dim strWhere as String
If Not IsNull(Me.cboCoilNumber) Then
strWhere = "[Coil Number]=""" & Me.cboCoilNumber & """"
End If
DoCmd.OpenReport, "rptYourReport", acPreview, , strWhere

--
Duane Hookom
MS Access MVP

John Calder said:
Hi

I run W2K and Access 2K

This is my 1st database. I have created a database that has the following
fields:

Date (formatted to date)
Time (formatted to time)
Crew (taken from another table)
Coil Number (formatted to text)
Edge Damage (formatted to memo box)
Bore Dents (formatted to memo box)
Comments (formatted to memo box)


What I would like is to create a report that I can type in a Coil Number
and
the information for that coil number only is shown on the report. Can
anyone
help?

Any help is much appreciated

John
 
D

Duane Hookom

You can use a standard text box if you want. The [...] will always open the
query editor so you can graphically build the Row Source property value.

--
Duane Hookom
MS Access MVP

John Calder said:
Duane

I apologise if I have not explained things correctly. By adding a combo
box
I get a list of all the coil numbers that are in the database and as there
will eventually be thousands of them this will not meet my needs. I would
like to just have a box that I can type in the required coil number and
the
report will generate that number with all its associated data.

Also when I go to the Row Source and I select the three little dots it
automatically opens the query editor...is this correct?

As your instruction does not mention the query editor I am assuming I have
done something wrong.

As before all help is really appreciated

John


John Calder said:
Thanks Duane

Sorry about the double posting I wasnt sure which area to put it in.

I will give it a go tommorrow and let you know how I went

Thanks Again

John


Duane Hookom said:
Add a combo box to a form:
Name: cboCoilNumber
Control Source:
Row Source Type: table/query
Row Source: SELECT [Coil Number] FROM tblYourTable GROUP BY [Coil
Number];
Limit To List: Yes
Column Count: 1
Bound Column: 1

Then use the command button wizard to add a button that opens your
report.
Once the wizard has finished, view the code module created by the
wizard and
modify it to look something like:

Dim strWhere as String
If Not IsNull(Me.cboCoilNumber) Then
strWhere = "[Coil Number]=""" & Me.cboCoilNumber & """"
End If
DoCmd.OpenReport, "rptYourReport", acPreview, , strWhere

--
Duane Hookom
MS Access MVP

Hi

I run W2K and Access 2K

This is my 1st database. I have created a database that has the
following
fields:

Date (formatted to date)
Time (formatted to time)
Crew (taken from another table)
Coil Number (formatted to text)
Edge Damage (formatted to memo box)
Bore Dents (formatted to memo box)
Comments (formatted to memo box)


What I would like is to create a report that I can type in a Coil
Number
and
the information for that coil number only is shown on the report. Can
anyone
help?

Any help is much appreciated

John
 

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