C
CheyenneP
Hello:
I have VB code in Access that uses SQL string to "lookup" rates in a table.
The value that is returned in rs![Crew] is 12.33. I can see this when I put
a break in the code. But the value in [Forms]![frmHourlyEntry]!
[tblDatasubform]![Crew_Std] is 12 I need the 2 decimal places. I have
set all the formats in the table and forms to standard with 2 decimals places
but it doesn't work.
Here is the code. I tried the format statement that is commented out but it
gave me an object not found error.
Your help and time is appreciated.
Public Function GetStandards()
Dim db As Database
Dim rs As Recordset
Dim sSQL As String
sSQL = "SELECT * FROM tblStandardRates WHERE tblStandardRates.SAPItem = "
& "'" & [Forms]![frmHourlyEntry]![tblDatasubform]![Product] & "'" & ";"
Set db = CurrentDb
Set rs = db.OpenRecordset(sSQL, dbOpenDynaset)
If rs.RecordCount > 0 Then
'Format([Forms]![frmHourlyEntry]![tblDatasubform]![Crew_Std], "00.00")
= rs![Crew]
----MY PROBLEM IS IN THE STATEMENT BELOW
[Forms]![frmHourlyEntry]![tblDatasubform]![Crew_Std] = rs![Crew]
----MY PROBLEM IS IN THE STATEMENT ABOVE
I have VB code in Access that uses SQL string to "lookup" rates in a table.
The value that is returned in rs![Crew] is 12.33. I can see this when I put
a break in the code. But the value in [Forms]![frmHourlyEntry]!
[tblDatasubform]![Crew_Std] is 12 I need the 2 decimal places. I have
set all the formats in the table and forms to standard with 2 decimals places
but it doesn't work.
Here is the code. I tried the format statement that is commented out but it
gave me an object not found error.
Your help and time is appreciated.
Public Function GetStandards()
Dim db As Database
Dim rs As Recordset
Dim sSQL As String
sSQL = "SELECT * FROM tblStandardRates WHERE tblStandardRates.SAPItem = "
& "'" & [Forms]![frmHourlyEntry]![tblDatasubform]![Product] & "'" & ";"
Set db = CurrentDb
Set rs = db.OpenRecordset(sSQL, dbOpenDynaset)
If rs.RecordCount > 0 Then
'Format([Forms]![frmHourlyEntry]![tblDatasubform]![Crew_Std], "00.00")
= rs![Crew]
----MY PROBLEM IS IN THE STATEMENT BELOW
[Forms]![frmHourlyEntry]![tblDatasubform]![Crew_Std] = rs![Crew]
----MY PROBLEM IS IN THE STATEMENT ABOVE