Hello, I have a problem with my database and need some help.
My database has a main menu named MENU which allows to access all the
different forms of the program I am trying to develop. One of these
forms is named MASTER and has its source to the main table of my db
also named MASTER. To open the form and add a new recorset I simple
press a button to which I have associate the following simple code:
DoCmd.OpenForm ("Master")
DoCmd.GoToRecord , , acNewRec
Once in the form and add the data I have to close it so that it can be
saved. I then go back to the MENU form and use a listbox to open the
selected record. The listbox its based on a query of table MASTER and
has a criteria (SSN) that allows me to open the record with the double
click event.
My problem is that I need to append my data into different tables and
do not know a method which would allow me to do this without having
first to close the active form (MASTER) and then running the append
queries. Is there a way this can be done?
What I am trying to do is:
- Write my data into the active form
- Append my data from the active form into different other tables
without having to close the form
- Still have my active form opened in my database so that I can open
another form (CHILD).
Please note that after that I have closed the form, I am currently
using this code to append the Master Table to the other tables:
If Not IsNull(DLookup("[SSN]", "child", "[SSN] = '" & Me!SSN & "'"))
Then
Forms("MENU").Visible = False
Else
If IsNull(DLookup("[SSN]", "child", "[SSN] = '" & Me!SSN & "'")) Then
DoCmd.OpenQuery ("AppendChild")
End If
End If
DoCmd.OpenForm ("Child")
This avoids having to save twice the same data.
Can anyone help me on this?
Thanks.