Hi,
I am EXCEPTIONALLY ill-equipt to do anything with VB, all I do in VB is edit bits that are already there, and generally make them worse!!!
Anyway, I tried adding a line of code to this:
The line I added was:
DoCmd.close acForm, filtanksearch, acSaveNo
Basically, the code above opens a form (frm Fish Enter) and filters it on the field "tankname" in "filtanksearch" with the field "Tank" in the "frm Fish Enter" form.
What I wanted to do, was when it has loaded the second form, for the first one to close.
This post makes no sense, but I hope someone can understand it, as my brain fell out hours ago, and refuses to come back until this is got round!!!
Thanks in advance!
I am EXCEPTIONALLY ill-equipt to do anything with VB, all I do in VB is edit bits that are already there, and generally make them worse!!!
Anyway, I tried adding a line of code to this:
Code:
Private Sub go_Click()
On Error GoTo Err_go_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frm Fish enter"
stLinkCriteria = "[Tank ID]=" & Me![tankname]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_go_Click:
DoCmd.close acForm, filtanksearch, acSaveNo
Exit Sub
Err_go_Click:
MsgBox Err.Description
Resume Exit_go_Click
End Sub
The line I added was:
DoCmd.close acForm, filtanksearch, acSaveNo
Basically, the code above opens a form (frm Fish Enter) and filters it on the field "tankname" in "filtanksearch" with the field "Tank" in the "frm Fish Enter" form.
What I wanted to do, was when it has loaded the second form, for the first one to close.
This post makes no sense, but I hope someone can understand it, as my brain fell out hours ago, and refuses to come back until this is got round!!!
Thanks in advance!