Have searched everywhere for this one folks and no luck as yet...
I have a form at present with a cmd button that closes the current form opening a second that allows data entry...
I had finally found a way of populating fields in my new form with info taken from the first.
Now...probably getting to involved in the look and feel of my project here but what I'm trying to acheive is hopefully simple?
The On_Click of cmdADD_PC closed the current form (frmAdmin) and opened frmADD_PC...
The DID# field of ADD_PC was autofilled from frmAdmin:
=[Forms]![frmAdminDetails]![DID#]
this was working fine, in addition a 2nd field (Client) was populated with the following:
SELECT Dealers.Client FROM Dealers WHERE (((Dealers.dealerID) Like Forms!frmAdminDetails![DID#] & "*"));
this ref. the DID# and filled the Client field with the correct Dealer Name, so far so good I thought...
However when I introduced the following code to my cmdADD_PC control on frmAdmin the fields in frmADD_PC no longer auto-fill
On Error GoTo Err_ADD_PC_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmCompSpecs"
DoCmd.OpenForm stDocName, , , stLinkCriteria
DoCmd.Close acForm, "frmAdminDetails"
Exit_ADD_PC_Click:
Exit Sub
Err_ADD_PC_Click:
MsgBox Err.Description
Resume Exit_ADD_PC_Click
End Sub
this is successful in closing the current form and opening ADD_PC which gives the effect I want however as the frmAdmin is closed I take it that the field info lookup code on ADD_PC has no data to retrieve from frmAdmin (at least I hope this is the case)
So I wandered if there was a simple way to instead of close the frmAdmin, set it's visibility to No on the Load event of frmADD_PC as I take it this might prevent this problem with the field lookup I have set...?
I'm a complete and utter virgin in regards of VB and I'm trying to work things through slowly here, so any pointers in the right direction would be great folks
Many thanks for any interest and suggestions
zym
I have a form at present with a cmd button that closes the current form opening a second that allows data entry...
I had finally found a way of populating fields in my new form with info taken from the first.
Now...probably getting to involved in the look and feel of my project here but what I'm trying to acheive is hopefully simple?
The On_Click of cmdADD_PC closed the current form (frmAdmin) and opened frmADD_PC...
The DID# field of ADD_PC was autofilled from frmAdmin:
=[Forms]![frmAdminDetails]![DID#]
this was working fine, in addition a 2nd field (Client) was populated with the following:
SELECT Dealers.Client FROM Dealers WHERE (((Dealers.dealerID) Like Forms!frmAdminDetails![DID#] & "*"));
this ref. the DID# and filled the Client field with the correct Dealer Name, so far so good I thought...
However when I introduced the following code to my cmdADD_PC control on frmAdmin the fields in frmADD_PC no longer auto-fill

On Error GoTo Err_ADD_PC_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmCompSpecs"
DoCmd.OpenForm stDocName, , , stLinkCriteria
DoCmd.Close acForm, "frmAdminDetails"
Exit_ADD_PC_Click:
Exit Sub
Err_ADD_PC_Click:
MsgBox Err.Description
Resume Exit_ADD_PC_Click
End Sub
this is successful in closing the current form and opening ADD_PC which gives the effect I want however as the frmAdmin is closed I take it that the field info lookup code on ADD_PC has no data to retrieve from frmAdmin (at least I hope this is the case)
So I wandered if there was a simple way to instead of close the frmAdmin, set it's visibility to No on the Load event of frmADD_PC as I take it this might prevent this problem with the field lookup I have set...?
I'm a complete and utter virgin in regards of VB and I'm trying to work things through slowly here, so any pointers in the right direction would be great folks

Many thanks for any interest and suggestions

zym