Code not working ( option box)
Posted on 2002-03-14
I have the following code behind a form. I have option boxes to select and the result is going into the table "Orders" fine. but,,, it is not putting the results the way I would like to see it. For example
In my code I have that when the type of payment is option box 1 then I would like to see in the table "CK" not number 1 but is not doing what I want, instead it is putting the number 1 instead of the "CK".
Any ideas of what I could be doing wrong or what should I change or add. Please give sample codes.
Here is what I have.
'Takes the information from the Option group and puts it into the table in the correct
'string or text form
Dim MyDatabase As Database, Temporder As Recordset
Set MyDatabase = CurrentDb 'DBEngine.Workspaces(0).Databases(0) ' Get current database.
Set Temporder = MyDatabase.OpenRecordset("Orders", dbOpenTable) ' Create Recordset.
' check that records exists
If .BOF And .EOF Then
' no records in the table
''''''here begin option box for the deposit fund numbers
Select Case Trim(![Type of Payment])
Case "1": ![Type of Payment] = "ck"
Case "2": ![Type of Payment] = "po"
Case "3": ![Type of Payment] = "rn"
Case "4": ![Type of Payment] = "ca"
Case "5": ![Type of Payment] = "eft"
Case Else: ' any other value?