I read this as if your field is called "[Position / Shift]". Now that is asking for trouble: spaces and a special character in a
fieldname.
I would advise to get rid of all spaces in every table\fieldname. Maybe Access indeed gets confused, just because this is not good
coding practice....
Jacques
Hi John,
I know that SendKeys is not usually the first choice -
thanks for the heads-up.
The prompt I'm trying to avoid is from a formula from a
query that I've created. The formula is below...
Shift: IIf([All Agents].[Position / Shift] Is Null,"No
Shift Specified" & " -- " & ([All Agents].[Employee
Name]),Left([All Agents].[Position / Shift],1))
The [All Agents].[Position / Shift] contains shifts
like "FT1, FT2, PT2, PT4" so I want to capture only the
first letter and if the value is null, then I want it to
pull the name of the person who's shift value is null.
When I do the query, it doesn't prompt, but when I
generate the report from the query, it prompts me for that
field. I simply hit "ENTER" and it give me the info
correctly.
I'm using Access97, so I don't know if this is something
that I can avoid - I think Access is just getting confused
somewhere. The fact that it doesn't work on the query
leads me to believe that there's not much else I can to
get around it.
I'm sure you have a couple suggestions, however...;-)
m
Quote:
>-----Original Message-----
>Help should be saying that it expects a STRING as the
first parameter. Try:
Quote:
>Private Sub lblreportlink_Click()
> SendKeys "{ENTER}", True
>End Sub
>BUT it is normally a BAD thing to use SendKeys. There
are timing issues and
Quote:
>side effects.
>What prompt are you trying to avoid? Perhaps there is a
better way of handling
Quote:
>the situation.
>> I'm trying to do the most basic action using VBA. I
have
>> a report that I want to generate, but I want to bypass a
>> prompt that comes up, so I want to automate the "Enter"
>> key before the report opens.
>> The report is opened via a label box that is hyperlinked
>> to the Report object. So, I go to the "OnClick"
selection
>> on the label properties and right this code behind the
>> form....
>> Private Sub lblreportlink_Click()
>> SendKeys {ENTER}, True
>> End Sub
>> I get Compile Error saying "Invalid character". This is
>> exactly what the help files are telling me to do and its
>> not working.
>> Thanks ahead of time for your help.....
>> Matt
>.