condition criteria for forms (1 Viewer)

rjkimme

Registered User.
Local time
Today, 01:45
Joined
Jul 31, 2001
Messages
15
I have two buttons: Archive and Activate that both call the same form: ListForm. This form has a list box of employees which you then double click on the employee you wish to alter and another form: frmautostatus opens with the employee info. Problems: I need the ListForm to only list those employees either active or inactive depending on the button chosen. Then when a selection is made from the ListForm and the employee info is displayed, one of the fields is: status. To reverse the acivitiy of an employee I want the user to either select active (in this case inactive would have originally been displayed) or inactive(of course active had been displayed) and then hit the submit button and the database field value is changed per the form. **Not working right now. Please give detailed and simple response as not a savvy with access or code building.
 

Jack Cowley

Registered User.
Local time
Today, 01:45
Joined
Aug 7, 2000
Messages
2,639
In the code behind the Archive and Activate buttons use code like this:

DoCmd.OpenForm "FormList", , , , , ,"Archive"
DoCmd.OpenForm "FormList", , , , , ,"Activate"

In the On Load event of the FormList form put code like this:

If Not IsNull(Me.OpenArgs) Then
Select Case Me.OpenArgs
Case "Archive"
Me.ListBoxName.RowSource = "QueryToShowArchiveData"
Case "Activate"
Me.ListBoxName.RowSource = "QueryToShowNonArchiveData"
Case Else
Exit sub
End Select

That should give you a good start....


[This message has been edited by Jack Cowley (edited 10-18-2001).]
 

Users who are viewing this thread

Top Bottom