Hi, i have a group box with 2 radio buttons; failure and success. I need to have the text (either failure or success) saved in the access 2007 database instead of values (1 or 2). The same is also happening with the combo boxes.

Here's the code am using: (i want them to be added on a button click)

Private Sub Command55_Click()
Dim str1 As String
Dim str2 As String
Dim str3 As String

Dim str4 As String

'set combobox values
Dim str5 As String
Dim str6 As String
Dim str7 As String
Dim str8 As String

Dim cn As Connection
Dim rs As New ADODB.Recordset

str1 = Text27.Value
str2 = Diagnosis.Value
str3 = Solution.Value

str4 = Status.Value

'combo boxes
str5 = Departments.Value
str6 = Users.Value
str7 = Combo18Value
str8 = Combo20.Value

rs.Open "SELECT * FROM [Incidents]", CurrentProject.Connection, adOpenStatic, adLockOptimistic '

With rs
.Fields("Details") = str1
.Fields("Diagnosis") = str2
.Fields("Solution") = str3
.Fields("Status") = str4
.Fields("DeptName") = str5
.Fields("UserName") = str6
.Fields("Technician") = str7
.Fields("Problem") = str8

End With

End Sub

Any help will be appreciated.

7 Years
Discussion Span
Last Post by vb5prgrmr

thanx. However, when i use the combo.Text and Option1.Caption i can only save one combo box value. the rest are saved as numeric values for the combo boxes.

As for the radio buttons, should i declare the object capturing the data as a string? coz i did so and it brought and error.


Still a little unsure of what/why you are doing what you are doing so please explain further.

Perhaps a little more information on your table structure and exactly why you want the text versus the value.

Good Luck

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.