Kristoffer
New member
- Local time
- Yesterday, 19:54
- Joined
- Jun 3, 2013
- Messages
- 4
This must be obviously simple, but I've been slamming my head against the wall, nevertheless. :banghead:
Bottom-line: I display decimal values in a combo box for selection. When I try to convert a selected decimal into a string, or simply print the value, it appears multiplying that integer by 4. However, the selected decimal does get written correctly in the raw DB table.
Here are my data structures:
Table "Hours_List":
Column Name: "Hours"
Data Type: "Number"
Field Size: "Decimal"
Format: "Fixed"
Precision: "18"
Scale: "2"
Decimal Places: "2"
Note: Every row increments by 0.25, starting at 0.25 and ending at 250.00
Table "Activity":
Column Name: "Activity_Duration"
Data Type: "Number"
Field Size: "Decimal"
Format: "Fixed"
Precision: "18"
Scale: "2"
Decimal Places: "2"
Here are my controls:
Combobox "cboDuration":
(Resides on form "ActivityEditor")
Format: "Fixed"
Decimal Places: "2"
Row Source: "SELECT [Hours_List].[ID], [Hours_List].[Hours] FROM Hours_List ORDER BY [Hours]; "
Row Source Type: "Table/Query"
Bound Column: "1"
Limit to List: "Yes"
Allow Value List Edits: "No"
Expression to check the value selected in the combo box:
Private Sub cboDuration_AfterUpdate()
Example:
When I select "9.50" in the combo box, two "38"s print in the immediate (debug) window. What I want is for two "9.5"s to print!
Thanks for any help!!!
- Kris
Bottom-line: I display decimal values in a combo box for selection. When I try to convert a selected decimal into a string, or simply print the value, it appears multiplying that integer by 4. However, the selected decimal does get written correctly in the raw DB table.
Here are my data structures:
Table "Hours_List":
Column Name: "Hours"
Data Type: "Number"
Field Size: "Decimal"
Format: "Fixed"
Precision: "18"
Scale: "2"
Decimal Places: "2"
Note: Every row increments by 0.25, starting at 0.25 and ending at 250.00
Table "Activity":
Column Name: "Activity_Duration"
Data Type: "Number"
Field Size: "Decimal"
Format: "Fixed"
Precision: "18"
Scale: "2"
Decimal Places: "2"
Here are my controls:
Combobox "cboDuration":
(Resides on form "ActivityEditor")
Format: "Fixed"
Decimal Places: "2"
Row Source: "SELECT [Hours_List].[ID], [Hours_List].[Hours] FROM Hours_List ORDER BY [Hours]; "
Row Source Type: "Table/Query"
Bound Column: "1"
Limit to List: "Yes"
Allow Value List Edits: "No"
Expression to check the value selected in the combo box:
Private Sub cboDuration_AfterUpdate()
Dim TestString as String
Debug.Print Forms!ActivityEditor!cboDuration
TestString = CStr(Forms!ActivityEditor!cboDuration)
Debug.Print TestString
End SubDebug.Print Forms!ActivityEditor!cboDuration
TestString = CStr(Forms!ActivityEditor!cboDuration)
Debug.Print TestString
Example:
When I select "9.50" in the combo box, two "38"s print in the immediate (debug) window. What I want is for two "9.5"s to print!
Thanks for any help!!!
- Kris