M
mission2java_78
Guest
Long shot here but it is worth a try. Ill try to explain in a clear,
concise and short summary as to what my problem is. I dont want to bore
you guys. Ok..Im trying to use a find method of a MS PRoject object in vba.
Now this find method FROM help states the following:
------------------------------------------------------------------
Searches for an unfiltered value and returns True if it is found.
Syntax
expression.Find(Field, Test, Value, Next, MatchCase)
expression Optional. An expression that returns an Application object.
Field Required String. The name of the field to search.
Test Required String. The type of comparison made between Field and Value. Can be one of the following comparison strings:
Comparison string Description
"equals" The value of Field equals Value.
"does not equal" The value of Field does not equal Value.
"is greater than" The value of Field is greater than Value.
"is greater than or equal to" The value of Field is greater than or equal to Value.
"is less than" The value of Field is less than Value.
"is less than or equal to" The value of Field is less than or equal to Value.
"is within" The value of Field is within Value.
"is not within" The value of Field is not within Value.
"contains" Field contains Value.
"does not contain" Field does not contain Value.
"contains exactly" Field exactly contains Value.
Value Required String. The value to compare with the value of the field specified with Field.
Next Optional Boolean. True if Microsoft Project searches down for the next occurrence of matching search criteria. False if the program searches up for the next occurrence. The default value is False.
MatchCase Optional Boolean. True if the search is case-sensitive. The default value is False.
Remarks
Using the Find method without specifying any arguments displays the Find dialog box.
--------------------------0-----------------------------------------------
Fine and dandy the first line says:
Searches for an unfiltered value and returns true if it is found. Ok so why cant
I do the following behind an access button in vba:
Dim x As Boolean
x = prjApp.Find("Number1", "equals", Me.RecordID, False, False)
I keep getting a mismatch pointing at find...if I just do a prjApp.Find() without
assigning to x it works BUT I need to check if the value was found or not. This
is very crucial because this involves sending data from a db application to MS Project.
I DO NOT want to send the data if "Number1" is not found. Me.RecordID refers
to the record id in the database. Number1 is a field in ms project which should match
it. I have tried everything such as
if prjApp.Find("Number1", "equals", Me.RecordID, False, False) = true
if prjApp.Find("Number1", "equals", Me.RecordID, False, False)
and I tried the boolean of dimming and assigning.
I tried without the '('...I need my code to stop if Find cannot find the correct
record in Project. Right now I get an MS Project pop up which says Find has
searched the entire file and the field could not be found. So I click ok and it
continues executing my code. I need to stop it from executing if
it is not found. Any suggestions would be great.
Thanks,
Jon
concise and short summary as to what my problem is. I dont want to bore
you guys. Ok..Im trying to use a find method of a MS PRoject object in vba.
Now this find method FROM help states the following:
------------------------------------------------------------------
Searches for an unfiltered value and returns True if it is found.
Syntax
expression.Find(Field, Test, Value, Next, MatchCase)
expression Optional. An expression that returns an Application object.
Field Required String. The name of the field to search.
Test Required String. The type of comparison made between Field and Value. Can be one of the following comparison strings:
Comparison string Description
"equals" The value of Field equals Value.
"does not equal" The value of Field does not equal Value.
"is greater than" The value of Field is greater than Value.
"is greater than or equal to" The value of Field is greater than or equal to Value.
"is less than" The value of Field is less than Value.
"is less than or equal to" The value of Field is less than or equal to Value.
"is within" The value of Field is within Value.
"is not within" The value of Field is not within Value.
"contains" Field contains Value.
"does not contain" Field does not contain Value.
"contains exactly" Field exactly contains Value.
Value Required String. The value to compare with the value of the field specified with Field.
Next Optional Boolean. True if Microsoft Project searches down for the next occurrence of matching search criteria. False if the program searches up for the next occurrence. The default value is False.
MatchCase Optional Boolean. True if the search is case-sensitive. The default value is False.
Remarks
Using the Find method without specifying any arguments displays the Find dialog box.
--------------------------0-----------------------------------------------
Fine and dandy the first line says:
Searches for an unfiltered value and returns true if it is found. Ok so why cant
I do the following behind an access button in vba:
Dim x As Boolean
x = prjApp.Find("Number1", "equals", Me.RecordID, False, False)
I keep getting a mismatch pointing at find...if I just do a prjApp.Find() without
assigning to x it works BUT I need to check if the value was found or not. This
is very crucial because this involves sending data from a db application to MS Project.
I DO NOT want to send the data if "Number1" is not found. Me.RecordID refers
to the record id in the database. Number1 is a field in ms project which should match
it. I have tried everything such as
if prjApp.Find("Number1", "equals", Me.RecordID, False, False) = true
if prjApp.Find("Number1", "equals", Me.RecordID, False, False)
and I tried the boolean of dimming and assigning.
I tried without the '('...I need my code to stop if Find cannot find the correct
record in Project. Right now I get an MS Project pop up which says Find has
searched the entire file and the field could not be found. So I click ok and it
continues executing my code. I need to stop it from executing if
it is not found. Any suggestions would be great.
Thanks,
Jon