liquidspaces
Well-known member
Ok, this is what Im doing. On the Form1_Load event, Im writing the string "TEMP" to the "SHIP_FROM" field in the database. Im doing this so the autonumber will be ready and waiting. This part works fine:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim objRow As DataRow
objRow = DataSet31.Tables("Shipping").NewRow
objRow.Item("SHIP_FROM") = "TEMP"
DataSet31.Tables("Shipping").Rows.Add(objRow)
OleDbDataAdapter2.Update(DataSet31)
End Sub
Its this part that I believe Im having problems with. I need to get the value of the "BILL_OF_LADING_NUM" field, but instead the ROW NUMBER is returned.
Private Sub txtName_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtName.TextChanged
Dim intBOLN As Integer
intBOLN = OleDbDataAdapter2.Fill(DataSet31, "BILL_OF_LADING_NUM")
lblBOLN.Text = intBOLN
End Sub
The SQL statement included in OleDbDataAdapter2 is as follows:
SELECT SHIP_FROM, BILL_OF_LADING_NUM FROM Shipping WHERE (SHIP_FROM = TEMP)
After I get the autonumber, "TEMP" will be written over with whatever the real value may be.
There must be a simple solution. All I need is to assign the value of BILL_OF_LADING_NUM to lblBOLN.
Thanks,
Kevin
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim objRow As DataRow
objRow = DataSet31.Tables("Shipping").NewRow
objRow.Item("SHIP_FROM") = "TEMP"
DataSet31.Tables("Shipping").Rows.Add(objRow)
OleDbDataAdapter2.Update(DataSet31)
End Sub
Its this part that I believe Im having problems with. I need to get the value of the "BILL_OF_LADING_NUM" field, but instead the ROW NUMBER is returned.
Private Sub txtName_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtName.TextChanged
Dim intBOLN As Integer
intBOLN = OleDbDataAdapter2.Fill(DataSet31, "BILL_OF_LADING_NUM")
lblBOLN.Text = intBOLN
End Sub
The SQL statement included in OleDbDataAdapter2 is as follows:
SELECT SHIP_FROM, BILL_OF_LADING_NUM FROM Shipping WHERE (SHIP_FROM = TEMP)
After I get the autonumber, "TEMP" will be written over with whatever the real value may be.
There must be a simple solution. All I need is to assign the value of BILL_OF_LADING_NUM to lblBOLN.
Thanks,
Kevin