VBA Code Stopped Working (Please Help!!!!!)
I have been writing some VBA code to set the value of unbound text boxes to the combined values of bound textboxes. The first code that I wrote was this:
Me.FullAddressTxt.Value = [EventStTxt] & " " & [EventCityTxt] & ", " & [EventStateCombo] & " " & [EventZipTxt]
DoCmd.RunCommand acCmdRefresh
Me.FullAddressTxt.SetFocus
DoCmd.RunCommand acCmdCopy
Shell ("Firefox www.mapquest.com")
It worked fine until today. Now it gives a run-time error '2110' and says that Access can't move the focus to FullAddressTxt.
I learned that this stopped working when I re-visited it after some other code didn't work. The purpose of the new code is the same as the first. This is the new code:
Me.PublicEmailTxt.Value = [Forms!"ZooMobile Booking Form-New Client"!Organization] & "; " & [Date_of_Event] & "; " & [Start_Time] & "-" & [End_Time] & "; " & [Event_City] & ", " & [Event_State]
The run-time error with this one is '2465'. I open up the debugger and it's saying that the problem is that Me.PublicEmailTxt.Value is Null. Of course it is; the whole point of the code is to fill it in.
Why is it that a code that used to work no longer works and a code that is based on the same structure doesn't work? And why would the errors be different? The setting values part of the first code still works, so why doesn't it work in the second one?
Please help. Thanks.
I have been writing some VBA code to set the value of unbound text boxes to the combined values of bound textboxes. The first code that I wrote was this:
Me.FullAddressTxt.Value = [EventStTxt] & " " & [EventCityTxt] & ", " & [EventStateCombo] & " " & [EventZipTxt]
DoCmd.RunCommand acCmdRefresh
Me.FullAddressTxt.SetFocus
DoCmd.RunCommand acCmdCopy
Shell ("Firefox www.mapquest.com")
It worked fine until today. Now it gives a run-time error '2110' and says that Access can't move the focus to FullAddressTxt.
I learned that this stopped working when I re-visited it after some other code didn't work. The purpose of the new code is the same as the first. This is the new code:
Me.PublicEmailTxt.Value = [Forms!"ZooMobile Booking Form-New Client"!Organization] & "; " & [Date_of_Event] & "; " & [Start_Time] & "-" & [End_Time] & "; " & [Event_City] & ", " & [Event_State]
The run-time error with this one is '2465'. I open up the debugger and it's saying that the problem is that Me.PublicEmailTxt.Value is Null. Of course it is; the whole point of the code is to fill it in.
Why is it that a code that used to work no longer works and a code that is based on the same structure doesn't work? And why would the errors be different? The setting values part of the first code still works, so why doesn't it work in the second one?
Please help. Thanks.
Last edited: