B
bhp
I've been using Access for a while, but I've never learned VBA. Now I'm
trying to create a new database that requires VBA for some of the forms. Hope
someone out there can help.
I have a table that is used to track requests. The requests are connected to
items in another table, which are tracked by serial number. On the form for
the item requests, I want to be able to click a button, access a form with
the item listed ( based on its serial number), and copy the date shipped
field from the request to the date shipped field in the item's record.
I can't connect the two tables for multiple reasons. One, the requests come
in but the item isn't linked to it until later, so I can't add the request if
it is part of the item's record. Two, the requests also include what item
they shipped back, which is from the same table.
For the button so far, I used the button creation wizard to access the items'
records. Here is the code it created:
Private Sub UpdateSent_IEPU_Click()
On Error GoTo Err_UpdateSent_IEPU_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "IEPU history"
stLinkCriteria = "[IEPU_SN]=" & "'" & Me![IEPU Sent] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_UpdateSent_IEPU_Click:
Exit Sub
Err_UpdateSent_IEPU_Click:
MsgBox Err.Description
Resume Exit_UpdateSent_IEPU_Click
End Sub
If anyone does have any idea for making the button work, or for simplifing
the tables, I'd really appreciate it.
trying to create a new database that requires VBA for some of the forms. Hope
someone out there can help.
I have a table that is used to track requests. The requests are connected to
items in another table, which are tracked by serial number. On the form for
the item requests, I want to be able to click a button, access a form with
the item listed ( based on its serial number), and copy the date shipped
field from the request to the date shipped field in the item's record.
I can't connect the two tables for multiple reasons. One, the requests come
in but the item isn't linked to it until later, so I can't add the request if
it is part of the item's record. Two, the requests also include what item
they shipped back, which is from the same table.
For the button so far, I used the button creation wizard to access the items'
records. Here is the code it created:
Private Sub UpdateSent_IEPU_Click()
On Error GoTo Err_UpdateSent_IEPU_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "IEPU history"
stLinkCriteria = "[IEPU_SN]=" & "'" & Me![IEPU Sent] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_UpdateSent_IEPU_Click:
Exit Sub
Err_UpdateSent_IEPU_Click:
MsgBox Err.Description
Resume Exit_UpdateSent_IEPU_Click
End Sub
If anyone does have any idea for making the button work, or for simplifing
the tables, I'd really appreciate it.