freek
July 15th, 1999, 03:25 AM
I have written some code to check if the value (definded as currency) selected by the user in a combo box, is present in another table, but when the value is a float (, as separator symbol) it gives the error "syntax error (comma) in expression). The variable used for the selected value is [forms]![tarieven].[combo3]
I have already tried to put that first in a variable that was defined as currency, but that didn' t help.
Does anyone know how to resolve this problem?
public Sub controle()
on error GoTo controle_error
Dim dbs as Database
Dim rst as Recordset
set dbs = CurrentDb
set rst = dbs.OpenRecordset("Tarieven", dbOpenSnapshot)
rst.FindFirst "tarief = " & [Forms]![tarieven].[Combo3] & _
" and sofinr = '" & [Forms]![tarieven].[Sofinr] & "'"
If rst.NoMatch then
MsgBox "Tarief kan niet gewijzigd of gewist worden: " & _
"Verander eerst het standaardtarief", vbOKOnly + vbSystemModal
Form.Undo
End If
controle_exit:
rst.Close
Exit Sub
controle_error:
MsgBox Err.Number & " " & Err.Description
GoTo controle_exit
End Sub
ps I already posted a message where I said that I had a problem with a combobox and currency values, but now it seems that the error wasn' t in the combobox itself
I have already tried to put that first in a variable that was defined as currency, but that didn' t help.
Does anyone know how to resolve this problem?
public Sub controle()
on error GoTo controle_error
Dim dbs as Database
Dim rst as Recordset
set dbs = CurrentDb
set rst = dbs.OpenRecordset("Tarieven", dbOpenSnapshot)
rst.FindFirst "tarief = " & [Forms]![tarieven].[Combo3] & _
" and sofinr = '" & [Forms]![tarieven].[Sofinr] & "'"
If rst.NoMatch then
MsgBox "Tarief kan niet gewijzigd of gewist worden: " & _
"Verander eerst het standaardtarief", vbOKOnly + vbSystemModal
Form.Undo
End If
controle_exit:
rst.Close
Exit Sub
controle_error:
MsgBox Err.Number & " " & Err.Description
GoTo controle_exit
End Sub
ps I already posted a message where I said that I had a problem with a combobox and currency values, but now it seems that the error wasn' t in the combobox itself