Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Form.Recordsource does not return rows

Status
Not open for further replies.

LittleNick

Technical User
Jun 26, 2009
55
US
Hello Everyone,
This is my first post, so I hope I am doing it correctly.

My problem is: I have a commnad button when clicked it would open 2 forms. 1 is the user form and the other is the suspense form (one next to the other). In the suspense form I have a combo box and when select an option it would display a list of task for that option. When ONLY the suspense form is open, it returned a correct task list as tested, but when both forms are opened, with the same action, the suspense form does not return any rows.
I am listing a part of the code I have below:

Private Sub TeamSelection_AfterUpdate()

Dim varTeam As String


varTeam = DLookup........

If (TeamSelection.Value = "Team1") Then
If (varTeam = "Manager" Or varTeam = TeamSelection.Value) Then
Forms!frmsuspense.RecordSource = "select * from vSuspensebyTeam where [Team#] = 1 order by suspensedate"
End If
Else
MsgBox "No Permision"
End If
......
Could you please let me know why when the form is opened individually, it would work but when both are opened it would not return any rows? Thanks
 
Code:
TeamSelection_AfterUpdate()
This doesn't make sense here. _Click would work for a button; _Load would work the new form.
 
I've done similar things... but the approach was different...

One the secondary form, in the load event (I believe) I would set the record source based on values from the primary form. So for example in secondary form load event

IF Forms!PrimaryForm.Field.Value = 'x'
Then...

htwh,



Steve Medvid
IT Consultant & Web Master

Chester County, PA Residents
Please Show Your Support...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top