Hello there,
For this question I searched alot on the internet. And I stared hours looking at my code and form design to find what was wrong, but I just couldn't find it.
So hopefully you guys can help me.
I have 2 forms.
Form 1: frm200Groep
- It shows a Continuous Form of the table tbl200Groep.
In there there is information about some special customers.
Every row on the continuous form has a Edit button. Pressing this supposed to open a popup form where you can edit the information.
Form 2: frm200GroepWijzigen (this is the edit popup form)
- It's a normal form where all the fields from the table are listed, it is supposed to display the information about the correct customer. The correct customer will be the row where I pressed the edit button on the continuous form "frm200Groep"
Now, the VBA code behind the EDIT button:
In frm200Groep there is a hidden field named "txt200GroepPK" which holds the PK autonumber field.
"200GroepPK" is the name of the autonumber field from the table which holds all the rows
But, when I press the button, I get the following error:
Where 10 will be the rownumber from the PK autonumber field.
The strange thing is, I have the exact same system for my employees forms and tables. The only difference is the name of some fields and the tables.
But, in the employees form it is working.
I already checked a dozen times if there was something I was missing, but just couldn't find it.
Can somesome see what is wrong? If there is more information needed, I would give it.
Thanks in advance
For this question I searched alot on the internet. And I stared hours looking at my code and form design to find what was wrong, but I just couldn't find it.
So hopefully you guys can help me.
I have 2 forms.
Form 1: frm200Groep
- It shows a Continuous Form of the table tbl200Groep.
In there there is information about some special customers.
Every row on the continuous form has a Edit button. Pressing this supposed to open a popup form where you can edit the information.
Form 2: frm200GroepWijzigen (this is the edit popup form)
- It's a normal form where all the fields from the table are listed, it is supposed to display the information about the correct customer. The correct customer will be the row where I pressed the edit button on the continuous form "frm200Groep"
Now, the VBA code behind the EDIT button:
Code:
Private Sub cmdGebruikerBewerken_Click()
DoCmd.OpenForm "frm200GroepWijzigen", , , "200GroepPK = " & Me.txt200GroepPK
End Sub
In frm200Groep there is a hidden field named "txt200GroepPK" which holds the PK autonumber field.
"200GroepPK" is the name of the autonumber field from the table which holds all the rows
But, when I press the button, I get the following error:
Run-time error '3075':
Syntax error (missing operator) in query expression '200GroepPK = 10'.
Where 10 will be the rownumber from the PK autonumber field.
The strange thing is, I have the exact same system for my employees forms and tables. The only difference is the name of some fields and the tables.
But, in the employees form it is working.
I already checked a dozen times if there was something I was missing, but just couldn't find it.
Can somesome see what is wrong? If there is more information needed, I would give it.
Thanks in advance