Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Requery does not update form after Append Query

Status
Not open for further replies.

namdam13

Technical User
May 20, 2009
7
Hi All,

Thanks for the help i have managed to get off of here so far from reading other peoples post but i have now hit a road block.

I have a Sub-Form(Query List)that I have button to open the record into another form so that it can be edited. I then have an append Query Button to assign the record a certiciafe number, in a linked table. This all seems to work fine. The problem is i dont seem to be able requery the editf orm so that the number appears once appended.

I have put the requery on a seperate button to work my way through it but this does not seem to work. I also though it might help to requery the original Form, but again no luck.
If i close the form and re-open it, my the cert number does appear.

Code as below:

Private Sub Command50_Click()

If IsNull(Text48) Then

On Error GoTo Err_Command51_Click

Dim stDocName As String

stDocName = "Beep_MCR"
DoCmd.RunMacro stDocName

Exit_Command51_Click:
Exit Sub

Err_Command51_Click:
MsgBox Err.Description
Resume Exit_Command51_Click



Else

'This will eventually have an append Macro in it

End If

'Requery original form and current form
Form_CS_FM.Requery
Me.Refresh

End Sub


Any help would be much appreciate. Thanks.
 
Can you tie some names in your text with names in the code?

Is the subform named "Query List" or is it displayed as datasheet? What are the "editf orm" and the "original Form"?

Where is the code to append a record?

Duane
Hook'D on Access
MS Access MVP
 
I manage to solve the problem by puting a Repaint command after the Requery of the form. This seemed to work fine. I did this by putting it in a macro.


Thanks for your help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top