S
scadav
I really was hoping someone could help me solve a problem and give me a
suggestion:
I have 2 forms:
Employees
EmployeesActivity
When in the Employees form, I click a button that opens up the
EmployeesActivity.
The EmployeesActivity is a continuous form that has a list of the
activity this employee has performed. On click, the DatabaseID from
the Employees Form should get populated into an unbound text box called
[txt_DatabaseID]. I do this as follows:
Private Sub bt_EmployeeActivity_Click()
On Error GoTo Err_bt_EmployeeActivity_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "EmployeesActivity"
stLinkCriteria = "[DatabaseID]=" & Me![DatabaseID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Forms!EmployeesActivity.txt_DatabaseID = Forms!Employees.DatabaseID
Exit_bt_EmployeeActivity_Click:
Exit Sub
Err_bt_EmployeeActivity_Click:
MsgBox Err.Description
Resume Exit_bt_EmployeeActivity_Click
End Sub
SELECT EmployeesActivity.ActivityID, EmployeesActivity.DatabaseID,
EmployeesActivity.Activty, EmployeesActivity.ActivityDate,
EmployeesActivity.ReviewType, EmployeesActivity.IncidentType
FROM EmployeesActivity
WHERE
(((EmployeesActivity.DatabaseID)=[Forms]![EmployeesActivity]![txt_DatabaseID])
AND ((EmployeesActivity.DeletedActivity)=False));
I have 1 problem & 1 question:
#1 - When I click the button from the Employees form, the unbound text
box does get the DatabaseID from the previous form, but I am unable to
see it. I know the id is there for 2 reasons: 1. When I click in
the text box the cursor will be placed somewhere after the number. If
I highlight the rest of the text box (moving to the left) and copy and
paste, into notepad, I will see the number in notepad. 2. If I
minimize the screen and then restore it, I am able to see the number.
#2 - Is setting the record source to a query, the best way to filter
all records on a continuous form?
Thanks in advance.
Dave
suggestion:
I have 2 forms:
Employees
EmployeesActivity
When in the Employees form, I click a button that opens up the
EmployeesActivity.
The EmployeesActivity is a continuous form that has a list of the
activity this employee has performed. On click, the DatabaseID from
the Employees Form should get populated into an unbound text box called
[txt_DatabaseID]. I do this as follows:
Private Sub bt_EmployeeActivity_Click()
On Error GoTo Err_bt_EmployeeActivity_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "EmployeesActivity"
stLinkCriteria = "[DatabaseID]=" & Me![DatabaseID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Forms!EmployeesActivity.txt_DatabaseID = Forms!Employees.DatabaseID
Exit_bt_EmployeeActivity_Click:
Exit Sub
Err_bt_EmployeeActivity_Click:
MsgBox Err.Description
Resume Exit_bt_EmployeeActivity_Click
End Sub
query. The query reads as follows:From there the EmployeesActivity form has a record source set to a
SELECT EmployeesActivity.ActivityID, EmployeesActivity.DatabaseID,
EmployeesActivity.Activty, EmployeesActivity.ActivityDate,
EmployeesActivity.ReviewType, EmployeesActivity.IncidentType
FROM EmployeesActivity
WHERE
(((EmployeesActivity.DatabaseID)=[Forms]![EmployeesActivity]![txt_DatabaseID])
AND ((EmployeesActivity.DeletedActivity)=False));
this employee.From here (hoping), I should get a list of all activity associated with
I have 1 problem & 1 question:
#1 - When I click the button from the Employees form, the unbound text
box does get the DatabaseID from the previous form, but I am unable to
see it. I know the id is there for 2 reasons: 1. When I click in
the text box the cursor will be placed somewhere after the number. If
I highlight the rest of the text box (moving to the left) and copy and
paste, into notepad, I will see the number in notepad. 2. If I
minimize the screen and then restore it, I am able to see the number.
#2 - Is setting the record source to a query, the best way to filter
all records on a continuous form?
Thanks in advance.
Dave