refresh button

  • Thread starter Thread starter Bill H.
  • Start date Start date
B

Bill H.

I have this snytax for using VBA to emulate a user clicking on the delete
record button:

DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70

How do I modify so it emulates a press of the F9 (refresh) key?

Using the Refresh command, in this case, does not refresh the subform, but
pressing F9 does, hence my request.

Thanks.
 
Have you tried using the Refresh command on the subform also?

Me.Refresh
Me.SubformControl.Form.Refresh
 
Nope, don't think I tried that.

Thanks.

Wayne Morgan said:
Have you tried using the Refresh command on the subform also?

Me.Refresh
Me.SubformControl.Form.Refresh
 
OK, tried it, just using the me.subform as a command button on the parent
form and the subform did NOT refresh.

Using the DoCmd.DoMenuItem acFormBar, acRecordsMenu, 5, , acMenuVer70 work.

Strange.

Wayne Morgan said:
Have you tried using the Refresh command on the subform also?

Me.Refresh
Me.SubformControl.Form.Refresh
 
Are you needing to Refresh or Requery? What happens if you use the previous
syntax but replace Refresh with Requery in the subform line?

--
Wayne Morgan
Microsoft Access MVP


Bill H. said:
OK, tried it, just using the me.subform as a command button on the parent
form and the subform did NOT refresh.

Using the DoCmd.DoMenuItem acFormBar, acRecordsMenu, 5, , acMenuVer70 work.

Strange.
 
Refresh only, as a command button populates the related table, but the
results do not show up on the subform until the F9 key is presses, or if you
go off and then back on the record.

Problems I've had with requery is that the record pointer goes back to the
first record.

:-0
 
The pointer problem can be overcome. Get the value of the ID field for the
record before you requery then move to that record after the requery.
 
Back
Top