Re: Search Feature not working

Tech-Archive recommends: Speed Up your PC by fixing your registry



Todd,

Is IncidentNo a numeric field? Because usually, unbound form controls seem to
default to string, or even variant, data types. Try changing all incidents of
txt_incidentnum to CInt(txt_incidentnum) or CInt(txt_incidentnum.Value) and
see if the code works.

Hope this helps,

Sam

Todd wrote:
I have a search feature on a main form where a user will enter a incident
number and it will bring up the record in a different form in order to edit
the data. When I try to use the feature, it will only provide the "Please
Enter a Valid Incident Number". The text box that I am using to enter the
value is called txt_incidentnum

Below is the code I am using. Can anyone see some stupid mistake I made?

Dim strwhere As String
Dim stDocName As String
If Me.txt_incidentnum > 0 Then
strwhere = "IncidentNo=" & Me.txt_incidentnum.Value
stDocName = "frm_DataEntry"
DoCmd.OpenForm stDocName, , , strwhere
Else
MsgBox "Please Enter a Valid Incident Number", vbExclamation, "Error"
Exit Sub
End If

Thanks

--
Sam

Message posted via http://www.accessmonster.com
.



Relevant Pages

  • Re: Entity and Identity
    ... since it isn't a model of computation but a broken type system mixed ... creation of reference types, which is an oxymoron. ... The big problem is that subtype relationships amongst data types don't ... hijacked to instead perform string value comparisons). ...
    (comp.databases.theory)
  • Re: SQL query... is there a better way?
    ... > What if I store a ListItem in ArrayList? ... Not if you want your app to perform as best it can. ... >> It really would help you to learn about data types. ... >> public string properties. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: How does GA toolbox represent double values?
    ... i did a google search on "real-coded GA", ... Rakesh Kumar wrote: ... >> some kind of bit string prior to GA optimization. ... >> data types? ...
    (comp.soft-sys.matlab)
  • Re: Aspects of programming languages in common
    ... > scalars) could be defined once, in one language, this definition to be ... Pascal allows array types. ... languages have a real string type. ... In fundamental ways C and Pascal strings are different data types. ...
    (comp.programming)
  • Re: Non-Standard Conventions
    ... True, it would result in inefficient code should the programmer define a type that isn't a natural addressable entity on the present system, but it would still work across platforms. ... That would be a natural feature to add associated features for handling a wide array of non-native data types, units, scaling, with little impact to existing intrinsic data types. ... One substantial reason Fortran doesn't have a bit string type ...
    (comp.lang.fortran)