If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Use Pop-Up to find record on tab control
All,
I have searched, played with the code and still have no solution so I am hoping someone has an answer. (Yep, I searched the newsgroups and still no joy!) Here's my problem/issue. I have a pop-up that opens from a form that has several tab pages. What I want to happen is I open the main form, select a Client from the list box. I then go to the Hardware Installed tab and select a machine. At that point I double-click on the machine and opens a pop-up to show me all the contracts that that particular machine has has. I now ant to double-click within the pop-up and have it go the tab Hardware Contracts and display that contract. (And just to make things more interesting, if I select another contract I want the Hardware Contracts to switch to that contract.) I have successfully done this before but never with a tab control involved and for that reason the lines I would normally use are not working. Below is some of what I have tried... Forms![frmContracts]![sfrHardwareContracts].SetFocus ***I guess you can't change LinkFields on the fly*** 'Forms![frmContracts]![sfrHardwareContracts].LinkChildFields = Me![txtHardwareContractsID] 'Forms![frmContracts]![sfrHardwareContracts].LinkMasterFields = Me![txtHardwareContractsID] Forms![frmContracts]![sfrHardwareContracts].Filter = Me![txtHardwareContractsID] 'Forms![frmContracts]![sfrHardwareContracts].Form![txtHardwareContractsID].SetFocus 'Forms![frmContracts]![sfrHardwareContracts].Form![txtHardwareContractsID] = Me![txtHardwareContractsID] ***This doesn't work because I can't seem to switch the focus to the subform though it does go to the tab page*** 'DoCmd.FindRecord FindThis, , True, acSearchAll, True 'Forms![frmContracts]![sfrHardwareContracts].Form![txtHardwareContractsID].Requery Any and all ideas would be appreciated!!!! BIG Thanks! Gina Whipp "I feel I have been denied critical, need to know, information!" - Tremors II |
#2
|
|||
|
|||
Use Pop-Up to find record on tab control
You I love it when a plan comes together! I got it...
I simply started AGAIN and ended up with... Forms![frmContracts]![sfrHardwareContracts].SetFocus With Forms![frmContracts]![sfrHardwareContracts].Form .RecordsetClone.FindFirst "hcHardwareContractsID = " & Me!txtHardwareContractsID If .RecordsetClone.NoMatch Then MsgBox "Record not found!" Else .Bookmark = .RecordsetClone.Bookmark End If End With Thanks anyway! Gina Whipp "I feel I have been denied critical, need to know, information!" - Tremors II "Gina Whipp" wrote in message ... All, I have searched, played with the code and still have no solution so I am hoping someone has an answer. (Yep, I searched the newsgroups and still no joy!) Here's my problem/issue. I have a pop-up that opens from a form that has several tab pages. What I want to happen is I open the main form, select a Client from the list box. I then go to the Hardware Installed tab and select a machine. At that point I double-click on the machine and opens a pop-up to show me all the contracts that that particular machine has has. I now ant to double-click within the pop-up and have it go the tab Hardware Contracts and display that contract. (And just to make things more interesting, if I select another contract I want the Hardware Contracts to switch to that contract.) I have successfully done this before but never with a tab control involved and for that reason the lines I would normally use are not working. Below is some of what I have tried... Forms![frmContracts]![sfrHardwareContracts].SetFocus ***I guess you can't change LinkFields on the fly*** 'Forms![frmContracts]![sfrHardwareContracts].LinkChildFields = Me![txtHardwareContractsID] 'Forms![frmContracts]![sfrHardwareContracts].LinkMasterFields = Me![txtHardwareContractsID] Forms![frmContracts]![sfrHardwareContracts].Filter = Me![txtHardwareContractsID] 'Forms![frmContracts]![sfrHardwareContracts].Form![txtHardwareContractsID].SetFocus 'Forms![frmContracts]![sfrHardwareContracts].Form![txtHardwareContractsID] = Me![txtHardwareContractsID] ***This doesn't work because I can't seem to switch the focus to the subform though it does go to the tab page*** 'DoCmd.FindRecord FindThis, , True, acSearchAll, True 'Forms![frmContracts]![sfrHardwareContracts].Form![txtHardwareContractsID].Requery Any and all ideas would be appreciated!!!! BIG Thanks! Gina Whipp "I feel I have been denied critical, need to know, information!" - Tremors II |
#3
|
|||
|
|||
Use Pop-Up to find record on tab control
Glad to see that you found a solution to your problem.
The reason why your attempt to change the Link Fields didn't work is because the LinkChildFields and LinkMasterFields properties are supposed to contain the name(s) of the fields being linked, not simply their values. In other words, you probably needed something like: Forms![frmContracts]![sfrHardwareContracts].LinkChildFields = "txtHardwareContractsID" Forms![frmContracts]![sfrHardwareContracts].LinkMasterFields = "txtHardwareContractsID" -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no private e-mails, please) "Gina Whipp" wrote in message ... All, I have searched, played with the code and still have no solution so I am hoping someone has an answer. (Yep, I searched the newsgroups and still no joy!) Here's my problem/issue. I have a pop-up that opens from a form that has several tab pages. What I want to happen is I open the main form, select a Client from the list box. I then go to the Hardware Installed tab and select a machine. At that point I double-click on the machine and opens a pop-up to show me all the contracts that that particular machine has has. I now ant to double-click within the pop-up and have it go the tab Hardware Contracts and display that contract. (And just to make things more interesting, if I select another contract I want the Hardware Contracts to switch to that contract.) I have successfully done this before but never with a tab control involved and for that reason the lines I would normally use are not working. Below is some of what I have tried... Forms![frmContracts]![sfrHardwareContracts].SetFocus ***I guess you can't change LinkFields on the fly*** 'Forms![frmContracts]![sfrHardwareContracts].LinkChildFields = Me![txtHardwareContractsID] 'Forms![frmContracts]![sfrHardwareContracts].LinkMasterFields = Me![txtHardwareContractsID] Forms![frmContracts]![sfrHardwareContracts].Filter = Me![txtHardwareContractsID] 'Forms![frmContracts]![sfrHardwareContracts].Form![txtHardwareContractsID].SetFocus 'Forms![frmContracts]![sfrHardwareContracts].Form![txtHardwareContractsID] = Me![txtHardwareContractsID] ***This doesn't work because I can't seem to switch the focus to the subform though it does go to the tab page*** 'DoCmd.FindRecord FindThis, , True, acSearchAll, True 'Forms![frmContracts]![sfrHardwareContracts].Form![txtHardwareContractsID].Requery Any and all ideas would be appreciated!!!! BIG Thanks! Gina Whipp "I feel I have been denied critical, need to know, information!" - Tremors II |
#4
|
|||
|
|||
Use Pop-Up to find record on tab control
Oddly enough when I tried that scenario it still prompted me for the values.
Now, I f I tied that in I got to the record but it didn't give me the seamless I wanted. I thought one couldn't change LinkFields without 'closing/reopening' the form? Is that rue or did I misread? -- Gina Whipp "I feel I have been denied critical, need to know, information!" - Tremors II "Douglas J. Steele" wrote in message ... Glad to see that you found a solution to your problem. The reason why your attempt to change the Link Fields didn't work is because the LinkChildFields and LinkMasterFields properties are supposed to contain the name(s) of the fields being linked, not simply their values. In other words, you probably needed something like: Forms![frmContracts]![sfrHardwareContracts].LinkChildFields = "txtHardwareContractsID" Forms![frmContracts]![sfrHardwareContracts].LinkMasterFields = "txtHardwareContractsID" -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no private e-mails, please) "Gina Whipp" wrote in message ... All, I have searched, played with the code and still have no solution so I am hoping someone has an answer. (Yep, I searched the newsgroups and still no joy!) Here's my problem/issue. I have a pop-up that opens from a form that has several tab pages. What I want to happen is I open the main form, select a Client from the list box. I then go to the Hardware Installed tab and select a machine. At that point I double-click on the machine and opens a pop-up to show me all the contracts that that particular machine has has. I now ant to double-click within the pop-up and have it go the tab Hardware Contracts and display that contract. (And just to make things more interesting, if I select another contract I want the Hardware Contracts to switch to that contract.) I have successfully done this before but never with a tab control involved and for that reason the lines I would normally use are not working. Below is some of what I have tried... Forms![frmContracts]![sfrHardwareContracts].SetFocus ***I guess you can't change LinkFields on the fly*** 'Forms![frmContracts]![sfrHardwareContracts].LinkChildFields = Me![txtHardwareContractsID] 'Forms![frmContracts]![sfrHardwareContracts].LinkMasterFields = Me![txtHardwareContractsID] Forms![frmContracts]![sfrHardwareContracts].Filter = Me![txtHardwareContractsID] 'Forms![frmContracts]![sfrHardwareContracts].Form![txtHardwareContractsID].SetFocus 'Forms![frmContracts]![sfrHardwareContracts].Form![txtHardwareContractsID] = Me![txtHardwareContractsID] ***This doesn't work because I can't seem to switch the focus to the subform though it does go to the tab page*** 'DoCmd.FindRecord FindThis, , True, acSearchAll, True 'Forms![frmContracts]![sfrHardwareContracts].Form![txtHardwareContractsID].Requery Any and all ideas would be appreciated!!!! BIG Thanks! Gina Whipp "I feel I have been denied critical, need to know, information!" - Tremors II |
#5
|
|||
|
|||
Use Pop-Up to find record on tab control
I know it's definitely possible to create a form/subform situation where the
fields are left blank and then assign them values in code. I haven't tested, though, whether it's possible to change the values when they're already linked. You might have to do a requery, but that should be it. -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no private e-mails, please) "Gina Whipp" wrote in message ... Oddly enough when I tried that scenario it still prompted me for the values. Now, I f I tied that in I got to the record but it didn't give me the seamless I wanted. I thought one couldn't change LinkFields without 'closing/reopening' the form? Is that rue or did I misread? -- Gina Whipp "I feel I have been denied critical, need to know, information!" - Tremors II "Douglas J. Steele" wrote in message ... Glad to see that you found a solution to your problem. The reason why your attempt to change the Link Fields didn't work is because the LinkChildFields and LinkMasterFields properties are supposed to contain the name(s) of the fields being linked, not simply their values. In other words, you probably needed something like: Forms![frmContracts]![sfrHardwareContracts].LinkChildFields = "txtHardwareContractsID" Forms![frmContracts]![sfrHardwareContracts].LinkMasterFields = "txtHardwareContractsID" |
#6
|
|||
|
|||
Use Pop-Up to find record on tab control
My fields are not blank, so perhaps the requery would have worked. I'll
have to give that try once I finish making my other changes. (Of course on a sample, hate to mess up what I finially got to work.) Thanks for the info! -- Gina Whipp "I feel I have been denied critical, need to know, information!" - Tremors II "Douglas J. Steele" wrote in message ... I know it's definitely possible to create a form/subform situation where the fields are left blank and then assign them values in code. I haven't tested, though, whether it's possible to change the values when they're already linked. You might have to do a requery, but that should be it. -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no private e-mails, please) "Gina Whipp" wrote in message ... Oddly enough when I tried that scenario it still prompted me for the values. Now, I f I tied that in I got to the record but it didn't give me the seamless I wanted. I thought one couldn't change LinkFields without 'closing/reopening' the form? Is that rue or did I misread? -- Gina Whipp "I feel I have been denied critical, need to know, information!" - Tremors II "Douglas J. Steele" wrote in message ... Glad to see that you found a solution to your problem. The reason why your attempt to change the Link Fields didn't work is because the LinkChildFields and LinkMasterFields properties are supposed to contain the name(s) of the fields being linked, not simply their values. In other words, you probably needed something like: Forms![frmContracts]![sfrHardwareContracts].LinkChildFields = "txtHardwareContractsID" Forms![frmContracts]![sfrHardwareContracts].LinkMasterFields = "txtHardwareContractsID" |
Thread Tools | |
Display Modes | |
|
|