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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Method or Data Member not Found

Status
Not open for further replies.

bailey11

Technical User
Jan 18, 2005
103
US
I have the following code and it works on one form, but not on the other. Th eform it doen't work on all the fields are unbound, but it simply tells the Activity Code drop down where to look.

I keep getting the error Method or Data Member Not Found. I highlights ".phasCB" each time.

Private Sub PhaseCB_AfterUpdate()
If Me.PhaseCB.Value = 99 And Me.TMCO.Value <> 0 Or Me.PhaseCB.Value = 98 Then
Me.ActivityCodeCB.RowSource = "SELECT projectno, ActivityCodeJ, ProjectName" & _
" FROM tblprojects" & _
" WHERE projectno='" & Me.[ProjectNoCB] & "'" & _
" AND Phase='" & Me.PhaseCB & "';"
Me.ActivityCodeCB.ColumnCount = 3
Me.ActivityCodeCB.ColumnHeads = True
Me.ActivityCodeCB.BoundColumn = 2

ElseIf Me.PhaseCB.Value = 99 And Me.TMCO.Value = 0 Or Me.PhaseCB.Value <= 97 Then
Me.ActivityCodeCB.RowSource = "SELECT Level1Code, ActivityCode, Description FROM tblActivityCodes WHERE AvailableforJobCoding=-1;"
Me.ActivityCodeCB.ColumnCount = 3
Me.ActivityCodeCB.ColumnHeads = True
Me.ActivityCodeCB.BoundColumn = 2

End If
End Sub

Thanks, Bailey11
 
Access can't find that control.
check the spelling of the control name,
and of it's name within your code.
 
I have and the control name is correct in all places. The form it works on, the fields are bound. The form it doesn't work, the fields are unbound and there is a button called "SAVE" that computates reular time hours vs. overtime hours and inserts all the fields into the timeentries table.

The code for each drop down is identical to the code that is workin on the other form, the only other variable I added was the "SAVE" button.

Any ideas?
 
??? It can't find the control "PhaseCB"?

Does the intellisense finish off your code,
when you type Me. ..., does PhaseCB, show up as an option?
 
Yes it does. That's why I can't fiure out what's wron.
 
I'm guessing your problem might be with the event. After Update events will only apply to bound fields.

Cheers,
Bill
 
I have three other unbound fields that are operating off the Afterupdate() without problems, based on defaulting a field from those drop down boxes.

Do you have an idea of what else it might be?

Thanks, Bailey11
 
Sorry about After Update comments, but of course you are right.

1. Have you tried compiling to see if anything turns up?
2. Remove the code in the procedure and just put in

MsgBox "Event works.", vbokonly

This will let you now where to focus.

Cheers,
Bill
 
THANK YOU!!!!!

I had misnamed the control "ActivityCodeCB". I corrected it and it works perfect.

THANK YOU THANK YOU
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top