First, I'm dangerous, I have learned what little VBA I know in a very ad-hoc manner so I may have messed up some very fundemental steps.
Problem: When I try to load a form with a sub-form, I receive the following error:
It seems to be related to the subform, because the main form will load after clicking 'OK', but the subform is just a big white square.
What I'm trying to do: I have 3 tables. A staff table, a project table, and a share table.
The staff table populates the main form, and has StaffID as a primary key. The share table populates the sub-form and contains foreign keys from both the Staff and Project tables. The Project table contains a list of information that I want to use to update records in the Share table.
So functionally, the user accesses the staff member of choice. Then in the subform, selects the project the staff member is associated with, and other information auto-populates the rest of the sub-form based on the project selection.
Table names = tbl_Staff_Master, tbl_Share, tbl_Projects
I only have 1 event procedure in the subform, and it was working as expected before I added the chunk in red:
Any helps, hints, suggestions, constructive critisim, or other productive comments are very much appriciated!
***************************************
Have a problem with my spelling or grammar? Please refer all complaints to my English teacher:
Ralphy "Me fail English? That's unpossible." Wiggum
Problem: When I try to load a form with a sub-form, I receive the following error:
This expression is typed incorrectly, or it is too complex to be evaluated. For example, a numeric expression may contain too many complicated elements. Try simplifying the expression by assigning parts of the expression to variables.
It seems to be related to the subform, because the main form will load after clicking 'OK', but the subform is just a big white square.
What I'm trying to do: I have 3 tables. A staff table, a project table, and a share table.
The staff table populates the main form, and has StaffID as a primary key. The share table populates the sub-form and contains foreign keys from both the Staff and Project tables. The Project table contains a list of information that I want to use to update records in the Share table.
So functionally, the user accesses the staff member of choice. Then in the subform, selects the project the staff member is associated with, and other information auto-populates the rest of the sub-form based on the project selection.
Table names = tbl_Staff_Master, tbl_Share, tbl_Projects
I only have 1 event procedure in the subform, and it was working as expected before I added the chunk in red:
Code:
Private Sub Combo53_Change()
Dim stProjIDTemp As String
Dim stStaffIDTemp As String
stProjIDTemp = "ProjID"
stStaffIDTemp = "staffID"
Me![Date Set 1].Value = Date
Me.Dirty = False
[red]
WHERE staffID = StaffIDTemp, ProjID = ProjIDTemp
Set tbl_Share.[Project Contact 1] = [tbl_Projects]![Project Contact] And tbl_Share.[Date Start 1] = [tbl_Projects]![Date Start] And tbl_Share.[Date End 1] = [tbl_Projects]![Date End]
[/red]
Me![Comment 1].SetFocus
DoCmd.Save
End Sub
Any helps, hints, suggestions, constructive critisim, or other productive comments are very much appriciated!
***************************************
Have a problem with my spelling or grammar? Please refer all complaints to my English teacher:
Ralphy "Me fail English? That's unpossible." Wiggum