I have a form called RetailEntry that has two columns I'm attempted to use as a string for when my users hit a Review button built into a separate form that pops up.
The following is a very simplified version of my code:
Private Sub ReviewButton_Click()
Dim strSeason As String
Dim strType As String
Set db = CurrentDb
strSeason = Forms!RetailEntry.Season.Value
strType = Forms!RetailEntry.Offer.Value
End Sub
When I click my review button I keep getting the error message "Invalid Use of Null" on my strings
strSeason = Forms!RetailEntry.Season.Value strType = Forms!RetailEntry.Offer.Value
but it shouldn't be seeing a null/blank as these are fields that are filled out in the form RetailEntry.
What happens next in the code (the part you don't see) is a string that setups up a SQL query uses the strSeason, and strType based on what was entered in the RetailEntry form under the corresponding fields.
I'm thinking it has to do with the fact that my Review button is it's own form but I'm not sure.
Any help would be greatly appreciated.
Thanks!
question from:
https://stackoverflow.com/questions/65892570/ms-access-vba-using-a-string-from-another-form 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…