VBKid04
04-16-2004, 06:10 PM
I have a form that is fully working, which I access by pressing a command button.
The form_load specifies a recordset to open, but...
I want to create a 2nd command button, which will open the same form but using a different recordset...
Can I open the same form while passing a different recordset for it to open (and how do i get this recordset I am passing to override the recordset specified on the actual form_load)?
Hopefully I can, as it will save me having to create a totally new form, which is exactly the same except with a different recordset.
If I cant do it this way, is there anyway on the form_load of the actual form that I could specify:
(ie. If user used command button 1 on main menu to get there)
If frmMain.cmdButton1 was pressed Then
Open ProperRecordset
(ie. If user used the new command button to get there)
Else If frmMain.cmdButton2 was pressed Then
Open DifferentRecordset
?
As well as that, I would like it so that if the LoginID (which can be found on frmMain.txtLogin.Text) equals any of the values in the newly opened recordset field LoginID, that the Edit command button would be enabled on the new form everytime it hits one of that users records, otherwise edit button should be disabled....
Is it also possible to do this?
Hope thats clear
Thanks for any help
The form_load specifies a recordset to open, but...
I want to create a 2nd command button, which will open the same form but using a different recordset...
Can I open the same form while passing a different recordset for it to open (and how do i get this recordset I am passing to override the recordset specified on the actual form_load)?
Hopefully I can, as it will save me having to create a totally new form, which is exactly the same except with a different recordset.
If I cant do it this way, is there anyway on the form_load of the actual form that I could specify:
(ie. If user used command button 1 on main menu to get there)
If frmMain.cmdButton1 was pressed Then
Open ProperRecordset
(ie. If user used the new command button to get there)
Else If frmMain.cmdButton2 was pressed Then
Open DifferentRecordset
?
As well as that, I would like it so that if the LoginID (which can be found on frmMain.txtLogin.Text) equals any of the values in the newly opened recordset field LoginID, that the Edit command button would be enabled on the new form everytime it hits one of that users records, otherwise edit button should be disabled....
Is it also possible to do this?
Hope thats clear
Thanks for any help