ByronJohnson
MIS
Hey Everyone,
I am stuck on this problem. I am trying to string together three different fields together and insert them into a table all within in the same column, same row.
Here is my code.
Private Sub cmdUpdate_Click()
Dim lacvar As Integer
Dim codonnum As Integer
Dim codonstr As String
lacvar = Forms!Sequence!lacIbase
codonnum = (lacvar Mod 3) + 1
Select Case codonnum
Case 1
codonstr = "Insert Into Sequence (AminoAcid) Select base from LACI where laci = " & lacvar & " or laci = " & lacvar & " + 1 or laci = " & lacvar & " + 2"
Case 2
codonstr = "Insert Into Sequence (AminoAcid) Select base from LACI where laci = " & lacvar & " - 1 or laci = " & lacvar & " or laci = " & lacvar & " + 1"
Case 3
codonstr = "Insert Into Sequence (AminoAcid) Select base from LACI where laci = " & lacvar & " - 2 or laci = " & lacvar & " - 1 or laci = " & lacvar & ""
End Select
lisAmino.RowSource = codonstr
End Sub
I think the problem is that it is not string the values together and it is trying to insert them three new rows and not in the same row.
Hope this makes senese and someone can help me out.
Byron Johnson
I am stuck on this problem. I am trying to string together three different fields together and insert them into a table all within in the same column, same row.
Here is my code.
Private Sub cmdUpdate_Click()
Dim lacvar As Integer
Dim codonnum As Integer
Dim codonstr As String
lacvar = Forms!Sequence!lacIbase
codonnum = (lacvar Mod 3) + 1
Select Case codonnum
Case 1
codonstr = "Insert Into Sequence (AminoAcid) Select base from LACI where laci = " & lacvar & " or laci = " & lacvar & " + 1 or laci = " & lacvar & " + 2"
Case 2
codonstr = "Insert Into Sequence (AminoAcid) Select base from LACI where laci = " & lacvar & " - 1 or laci = " & lacvar & " or laci = " & lacvar & " + 1"
Case 3
codonstr = "Insert Into Sequence (AminoAcid) Select base from LACI where laci = " & lacvar & " - 2 or laci = " & lacvar & " - 1 or laci = " & lacvar & ""
End Select
lisAmino.RowSource = codonstr
End Sub
I think the problem is that it is not string the values together and it is trying to insert them three new rows and not in the same row.
Hope this makes senese and someone can help me out.
Byron Johnson