Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Data Reports values do not change

Status
Not open for further replies.

dburnham

Programmer
Joined
Oct 18, 2001
Messages
118
Location
US
I have created a Data Report that pulls information directly from an Access Table. What I have done is queried several table and updated an additional table. I then .Show the report to print. After "X" cancelling the report I will Query different data, i.e. user ID, and the .SHOW the report again, however, the original data is still on the report.

How do I update the information on a data report.

I have tried closing and reopening the connection but nothing good comes from that.

I can provide the code if necessary.
 
I think in this case we will ne to read your code to understand better where is the failure.
Could you please provide it? AL Almeida
NT/DB Admin
"May all those that come behind us, find us faithfull"
 
Private Sub Command1_Click()
Dim strConn
Dim oConn As ADODB.Connection
Dim oRs As ADODB.Recordset
Dim oRs2 As ADODB.Recordset
Dim CartonsPerHour As Double
Dim Efficiency As Double
Dim UserSelectsID$

UserSelectsID$ = DataCombo1.Text

strConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Progress\chitest2.mdb;Persist Security Info=False"

strSQLSelect = "SELECT DailyProduction.`Date`,DailyProduction.ClockId," & _
" AssociateInfo.FirstName, AssociateInfo.LastName," & _
" DailyProduction.Task, TaskCodes.TaskDescription," & _
" TaskCodes.ProductionRate, TaskCodes.UnitOfMeasure," & _
" DailyHours.Hours, DailyProduction.Cartons, " & _
" DailyProduction.Stops" & _
" FROM AssociateInfo, DailyHours, DailyProduction," & _
" TaskCodes" & _
" WHERE AssociateInfo.ClockId = DailyHours.ClockId AND" & _ " AssociateInfo.ClockId = DailyProduction.ClockId AND" & _
" DailyHours.`Date` = DailyProduction.`Date` AND" & _
" DailyHours.Task = TaskCodes.TaskCode AND" & _
" DailyProduction.Task = TaskCodes.TaskCode AND " & _
" DailyProduction.[Date] = #" & Calendar1.Value & "# ORDER BY DailyProduction.[Date], DailyProduction.Task "

strSQLEfficiency = "SELECT Calculation.*" & _
"FROM Calculation"


Set oConn = New ADODB.Connection
oConn.Open strConn
Set oRs = New ADODB.Recordset
oRs.Open strSQLSelect, oConn, adOpenDynamic, adLockReadOnly

Set oRs2 = New ADODB.Recordset
oRs2.Open strSQLEfficiency, oConn, adOpenDynamic, adLockOptimistic





Do While Not oRs2.EOF
oRs2.MoveFirst
oRs2.Delete
oRs2.MoveNext

Loop

oRs.MoveFirst

Do While Not oRs.EOF And Not oRs.BOF
oRs2.AddNew

oRs2!ClockId = oRs!ClockId
oRs2!FirstName = oRs!FirstName
oRs2!LastName = oRs!LastName
oRs2!Hours = oRs!Hours
oRs2!Date = oRs!Date
oRs2!Cartons = oRs!Cartons
oRs2!Stops = oRs!Stops
oRs2!Task = oRs!Task
oRs2!TaskDescription = oRs!TaskDescription
oRs2!UnitOfMeasure = oRs!UnitOfMeasure
oRs2!ProductionRate = oRs!ProductionRate


oRs2!CartonsPerHour = oRs2!Cartons / oRs2!Hours
oRs2!Efficiency = oRs2!CartonsPerHour / oRs2!ProductionRate

oRs2.Update
oRs.MoveNext

Loop




If DataEnvironment1.rscomCalculations.State = adStateOpen Then
DataEnvironment1.rscomCalculations.Close
End If
DataEnvironment1.rscomCalculations.Open
DataEnvironment1.rscomCalculations.Requery
DataEnvironment1.Commands("comCalculations").Execute

rptEfficiency.Show

Set oRs = Nothing
Set oConn = Nothing

Set oRs2 = Nothing
Set oConn2 = Nothing
End Sub


+++++++
rptEfficiency is pulling data from DataEnvironment1.Connection2.comCalculations

I appreciate your assistance

David
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top