I've asked this before and got alot of good help, just nothing seems to get me past my problem.
I have a grid on a form, when someone clicks on a row, it should open a form with the contents of the record of that row. I have been able to pass the value of the grid ID with this:
Private Sub Open_frmListingEditForm()
Dim fListingEditForm As New frmListingEditForm
'fListingEditForm.SetReceive("Your ID value here")
fListingEditForm.SetReceive(intgridID)
fListingEditForm.ShowDialog()
End Sub
Then in the receiving form:
Public Sub SetReceive(ByVal Value As String)
txtReceive.Text = Value
IDTextBox.Text = Value
End Sub
Both fields txtReceive and IDTextBox are on the form. The txtReceive is not the ID of the record but IDTextBox is from the datasource. When the form opens, the txtReceive contains the correct value, but the IDTextBox contains the 1st record in the table and all the contents on the form belong to the 1st record.
Is there something else I need to do when opening the form to make sure it displays the correct record?
Also, if I want the form to open for new records (blank but just with a new ID from the autonum in the table, how do I do that?
I sure hope this makes sense, because it is so easy in Access, just can't figure it in VB. Thanks so much!
I have a grid on a form, when someone clicks on a row, it should open a form with the contents of the record of that row. I have been able to pass the value of the grid ID with this:
Private Sub Open_frmListingEditForm()
Dim fListingEditForm As New frmListingEditForm
'fListingEditForm.SetReceive("Your ID value here")
fListingEditForm.SetReceive(intgridID)
fListingEditForm.ShowDialog()
End Sub
Then in the receiving form:
Public Sub SetReceive(ByVal Value As String)
txtReceive.Text = Value
IDTextBox.Text = Value
End Sub
Both fields txtReceive and IDTextBox are on the form. The txtReceive is not the ID of the record but IDTextBox is from the datasource. When the form opens, the txtReceive contains the correct value, but the IDTextBox contains the 1st record in the table and all the contents on the form belong to the 1st record.
Is there something else I need to do when opening the form to make sure it displays the correct record?
Also, if I want the form to open for new records (blank but just with a new ID from the autonum in the table, how do I do that?
I sure hope this makes sense, because it is so easy in Access, just can't figure it in VB. Thanks so much!