problems: 1 in form, 1 in report

pullmyefinger

Registered User.
Local time
Today, 08:19
Joined
Feb 26, 2011
Messages
37
1. been reading on here trying to find out what to use to solve a 3464 data type mismatch. I understand the error but have tried to fix it with 3-5 conversion functions including CInt, Val, Eval(Left(... etc. and nothing works.

DoCmd.OpenReport "hieronly", , , "[hierarchy] = " & Chr$(34) & CInt(Left((Me.hirep), 1)) & Chr$(34)

Hierarchy is Number/Integer and hirep is a textbox, so I know the text must be conv to a number first, then evaluated. Not working.

I even tried Me.hirep.value with the functions and still no luck. Ideas??


2. Edit form, table attached to form. Form will edit and delete records via cmd buttons. How do I get the records in the form to display in SORTED Order by a particular field? I tried a select query with the field listed and in ASC order but that does not work either.

Also tried OnOrderby or whatever that is called, but don't know how to apply it.



Any Help?
 
1. Your use of CInt is inconsistent with using Chr(34) doesn't make sense.

2. If Hierarchy is a number then you don't want Chr(34)'s in there at all.


DoCmd.OpenReport "hieronly", WhereCondition:= "[hierarchy] = " & CInt(Left((Me.hirep), 1))
 
let's see what happens. Sorting problem solved already; I forgot about docmd.applyfilter.

Thanks Bob, worked first time out..
 

Users who are viewing this thread

Back
Top Bottom