Minty
AWF VIP
- Local time
- Today, 07:23
- Joined
- Jul 26, 2013
- Messages
- 10,569
I'll try and describe this as simply as possible.
Take a multi-column combo box where one of the columns is a Decimal/Number field sourced directly from a table.
The data type is a number type - Currency / Integer makes no odds, but it does allow nulls.
In VBA you assign that value to a variable for use later in a simple piece of code:
All of a sudden having been doing this for years, your column value is now returning an empty string "" instead of a Null, and gives you a type mismatch error.
Nz() doesn't help because of the ZLS being returned.
When did this helpful feature get introduced?
Is it just me or have I just never encountered this weird behaviour?
Using : Microsoft® Access® for Microsoft 365 MSO (Version 2411 Build 16.0.18227.20082) 64-bit
Simple example attached for clarity - pick the sales item in the drop down.
Take a multi-column combo box where one of the columns is a Decimal/Number field sourced directly from a table.
The data type is a number type - Currency / Integer makes no odds, but it does allow nulls.
In VBA you assign that value to a variable for use later in a simple piece of code:
Code:
Private Sub cmdAddRecord_Click()
''' Just an example
Dim ccDayRate As Currency
Debug.Print "Value is: " & Me.cboRecords.Column(2)
ccDayRate = Nz(Me.cboRecords.Column(2),0)
End Sub
All of a sudden having been doing this for years, your column value is now returning an empty string "" instead of a Null, and gives you a type mismatch error.
Nz() doesn't help because of the ZLS being returned.
When did this helpful feature get introduced?
Is it just me or have I just never encountered this weird behaviour?
Using : Microsoft® Access® for Microsoft 365 MSO (Version 2411 Build 16.0.18227.20082) 64-bit
Simple example attached for clarity - pick the sales item in the drop down.