Renaming a diagram

G

Guest

I have an open form with two diagrams which need to be updated automatically
as new data is imported. Both diagrams 'diff_gnl_old' and 'diff_gnl_new' are
drawing their data from tables which are already imported by another module
which is activated by a command button. I am trying to use another command
button to activate a module which will rename the current 'diff_gnl_new'
diagram to 'diff_gnl_old', and then use a newly imported table to generate a
new 'diff_gnl_new'. I'm trying to do this renaming using the 'DoCmd' object,
but my knowledge of VBA in Access and its syntax is rather shocking. This is
what I have so far:

Private Sub Befehl70_Click()
On Error GoTo Err_Befehl70_Click

DoCmd.Rename diff_gnl_old, acDiagram, diff_gnl_new


Exit_Befehl70_Click:
Exit Sub

Err_Befehl70_Click:
MsgBox Err.Description
Resume Exit_Befehl70_Click

End Sub

Is it possible to simply rename 'new' to 'old', import the table, and attach
this data to the 'new' diagram, preserving all the settings that were
originally there??

Any help appreciated
Mike M
 
G

Guest

I guess my basic question is: What is the code, using DoCmd if possible, to
simply rename the imported 'diff_gnl_new' table to 'diff_gnl_old', replacing
the old one.

Thanks
Mike M
 

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