Strange convert macros to vba

lbs

Registered User.
Local time
Today, 19:46
Joined
Dec 22, 2019
Messages
109
Is anyone experiencing the same issue as I am?
When I create a button to open a form with filter, access creates a macro for that. I don’t like macros and I then convert macro to vba by clicking appropriate button on ribbon. Then the button would not work because during the process access puts & in the wrong place inside [] in where condition of the code. I have to open code window and manually move & to the right place. This is happening all the time. Is it a bug in my ms office?

Also when I create a button to open a form filtered by date shown in a field I get wired results. For example the date is 03/02/2020 and the opening form shows records with the date 02/03/2020. I have to create a text date analog for date for the purpose of filtering.
 
Hi. Just curious, what is your Regional Settings?
 
I have on occasion converted macros into VBA. In the past this always seemed to work OK, but I have noticed problems recently. I've made notes on my website here:-

TempVars Value Error Video 1 (2:31)

I think you might find the first video video number one the most helpful.
 
When you do the conversion, is there a form running with a timer event?
If so, try disabling it.
 
Either that...or another form running in the background.
Timer events cause problems with the cursor jumping about when writing code in the VBE. I was wondering whether it could have a similar effect in your situation
 
When I create a button to open a form with filter, access creates a macro for that.
you can disable the macro option for events by going to File>Options>Object Designers - Form/Report Design View and tick the 'always use event procedures' option.

However not sure if this works if you are using the wizard which seems to always create a macro
 
However not sure if this works if you are using the wizard which seems to always create a macro

I tested on my 2007 and an embedded macro is created. :(

Apparently if the DB is an mdb file, then event code will be produced.
Just tested that with one of my few mdb files and it indeed does produce vba code.

HTH
 
you can disable the macro option for events by going to File>Options>Object Designers - Form/Report Design View and tick the 'always use event procedures' option.

However not sure if this works if you are using the wizard which seems to always create a macro


Tried is and still Macro is created.
 
only suggestion I can make is don't use the wizard and modify settings as I outlined
 

Users who are viewing this thread

Back
Top Bottom