Syntax error on requery

F

Frank Situmorang

Hello,

I have the church officer form that takes data from member table. I want it
if there is no member, I add the member than I can directly see in the church
officer form the added name. This is VBA:
Private Sub Form_AfterUpdate()
Forms!FRMPelayanJemaat!Nurut.Requery!Nurut.Requery
End Sub

This works perfectly when it is an additional record in the member table,
but if I want to edit the name when I see it wrong.

Then when I colse the member table, coz i want to go church officers form,
there is a debug saying syntax error, then I close the VBA windows, and I go
to chruch officers form, yes I can see the edited name to be in put in the
church officers form.

My question is why it happend to have a syntax error.

What I need to add in the above VBA.

Thanks in advance
 
F

Frank Situmorang

Hello Ruraguy:

I find it now that if the referred form is opened there is no debugging, how
can I make it if the referred form is not open or active, there is no requery.

Thi is my VBA:
Private Sub Form_AfterUpdate()
Forms!FRMPelayanJemaat!NamaPel.Requery
End Sub

Sorry I am not good in VBA, but more or less to say:
IF FRMPelayanJemaat_not Active
Forms!FRMPelayanJemaat!NamaPel.Requery = False
Else
Forms!FRMPelayanJemaat!NamaPel.Requery

Could you help me?
 
F

Frank Situmorang

Thanks very much Ruralguy, I modified a bit your suggestion by taking out the
word " Form" at the end, and it works:

If CurrentProject.AllForms("FRMPelayanJemaat").IsLoaded Then
Forms!FRMPelayanJemaat!NamaPel.Requery
End if

Thanks very much
--
H. Frank Situmorang


ruralguy via AccessMonster.com said:
Try:
Private Sub Form_AfterUpdate()

If CurrentProject.AllForms("FRMPelayanJemaat").IsLoaded Then
Forms!FRMPelayanJemaat!NamaPel.FORM.Requery
End If

End Sub


Frank said:
Hello Ruraguy:

I find it now that if the referred form is opened there is no debugging, how
can I make it if the referred form is not open or active, there is no requery.

Thi is my VBA:
Private Sub Form_AfterUpdate()
Forms!FRMPelayanJemaat!NamaPel.Requery
End Sub

Sorry I am not good in VBA, but more or less to say:
IF FRMPelayanJemaat_not Active
Forms!FRMPelayanJemaat!NamaPel.Requery = False
Else
Forms!FRMPelayanJemaat!NamaPel.Requery

Could you help me?
This link should help with the syntax:
http://www.mvps.org/access/forms/frm0031.htm
[quoted text clipped - 21 lines]
Thanks in advance

--
RuralGuy (RG for short) aka Allan Bunch MS Access MVP - acXP WinXP Pro
Please post back to this forum so all may benefit.

Message posted via AccessMonster.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top