Solved А problem with VBA Editor

tihmir

Registered User.
Local time
Today, 00:36
Joined
May 1, 2018
Messages
257
I have some problem with VBA Editor. When I try to use spacebar it does not allow me to move it forward and the beginning of the code turns red. What could be the problem
 
Are you typing in the editor while it is in debug mode?
 
Do you have a Form Timer running in the background?
 
So as not to post a new topic if I may ask something more. I have formA that have cboA with names of people and search button to filter the names (people) and their activities. So when I try to add new activite with comand button DoCmd.OpenForm "formB", , , , acFormAdd and save it with that code
DoCmd.RunCommand acCmdSaveRecord
Forms("formA").Requery
DoCmd.Close acForm, Me.Name

I want to go to formA on the filtering name at the last record (which I just created)
 
There are a few ways to do this, so here are a couple that I know. Before you close the form, open the other form with a where condition equal to the combo box (hopefully your combo box is bound to the unique key of the activity).

Code:
    DoCmd.OpenForm "FormA", , , "ActivityID=" & Me.cboB

Or, if FormB is a popup form and FormA is still open, you could possibly just:
Code:
    Forms!formA.cboA = Me.ActivityID

Where Me.ActivityID is known by Access as whatever record you have open in FormB before it closes.

My syntax could be wrong, but hopefully this can point you in the right direction.
 
There are a few ways to do this, so here are a couple that I know. Before you close the form, open the other form with a where condition equal to the combo box (hopefully your combo box is bound to the unique key of the activity).

Code:
    DoCmd.OpenForm "FormA", , , "ActivityID=" & Me.cboB

Or, if FormB is a popup form and FormA is still open, you could possibly just:
Code:
    Forms!formA.cboA = Me.ActivityID

Where Me.ActivityID is known by Access as whatever record you have open in FormB before it closes.

My syntax could be wrong, but hopefully this can point you in the right direction.

Thanks, zeroaccess. It is done
 

Users who are viewing this thread

Back
Top Bottom