A
Andy Roberts
2 questions which seem too specific to get an answer from Google etc hence
the post.
I have a client form (showing tblClients) and it has a subform which shows
all the individuals who work for the client company (tblClientRep). This
works fine - as I cycle through the client records the individuals change
based on the current client.
1. To add a new individual I have a button on my client form which opens a
ClientRep form where I enter the individual's details and on that form is a
cbo box which lists all the clients on the db, so I can assign the
individual to a client company. My first question is how do I automatically
fill the client cbo on the ClientRep form? The Client Rep form is triggered
from a specific client record so I should be able to carry this through so I
don't have to manually select the client from the cbo. Is this possible?
2. When I click the button to open the Add New Individual form I have the
main client form hidden using
me.visible.=false on the click event of the button (no problem so far...)
On the Individual form once I've input the data I have a button which closes
the form and unhides the original main form using...
Private Sub Form_Close()
Forms![frmClients].Visible = True
End Sub
.... on the on close event of the individual form.
This works fine, but I've now got to the stage where I have 2 separate forms
which open the same individual form and closing it using the button will
always unhide the frmClient. My second question is can the button use code
which closes the current form and unhides whatever the previous form was
irrespective of which form it is? I can get around the problem using two
identical forms with different names but this is becoming difficult to
maintain and what if I needed a 3rd form? I'm sure the duplicate form
approach is the wrong way forward.
--
Regards
Andy
___________
Andy Roberts
Win XP Pro
Access 2007
Liverpool, UK
the post.
I have a client form (showing tblClients) and it has a subform which shows
all the individuals who work for the client company (tblClientRep). This
works fine - as I cycle through the client records the individuals change
based on the current client.
1. To add a new individual I have a button on my client form which opens a
ClientRep form where I enter the individual's details and on that form is a
cbo box which lists all the clients on the db, so I can assign the
individual to a client company. My first question is how do I automatically
fill the client cbo on the ClientRep form? The Client Rep form is triggered
from a specific client record so I should be able to carry this through so I
don't have to manually select the client from the cbo. Is this possible?
2. When I click the button to open the Add New Individual form I have the
main client form hidden using
me.visible.=false on the click event of the button (no problem so far...)
On the Individual form once I've input the data I have a button which closes
the form and unhides the original main form using...
Private Sub Form_Close()
Forms![frmClients].Visible = True
End Sub
.... on the on close event of the individual form.
This works fine, but I've now got to the stage where I have 2 separate forms
which open the same individual form and closing it using the button will
always unhide the frmClient. My second question is can the button use code
which closes the current form and unhides whatever the previous form was
irrespective of which form it is? I can get around the problem using two
identical forms with different names but this is becoming difficult to
maintain and what if I needed a 3rd form? I'm sure the duplicate form
approach is the wrong way forward.
--
Regards
Andy
___________
Andy Roberts
Win XP Pro
Access 2007
Liverpool, UK