chrisjames25
Registered User.
- Local time
- Today, 13:08
- Joined
- Dec 1, 2014
- Messages
- 401
Hi. I have a mainform for my database. WIthin that I have an add variety button and below that in a subform a list of all current varieties. When i click add variety a new form opens and i create a new variety. What i want to be able to do is when i close the add variety form that the mainform/subform requeries and the newly added variety is visible.
I have achieved this on another form where i want the newly added variety to appear instantly in a combo box using the below code:
THe code relating to goat works correclty so i figured i could do same with goat2 for refreshing a subform but no such luck. Any suggestion how i should reference a subform correctly or is there an easier way than this?
I have achieved this on another form where i want the newly added variety to appear instantly in a combo box using the below code:
Code:
Private Sub Form_Close()
Dim Goat As String
Dim Goat2 As String
Goat = "Frm_BatchInput"
Goat2 = "Hemingford Plants"
If CurrentProject.AllForms(Goat).IsLoaded Then Forms(Goat).RequeryCBOTier3
If CurrentProject.AllForms(Goat2).IsLoaded Then Forms(Goat2).RequeryFrm_SubForm
End Sub
THe code relating to goat works correclty so i figured i could do same with goat2 for refreshing a subform but no such luck. Any suggestion how i should reference a subform correctly or is there an easier way than this?