Refer to Me![control-name] in MsgBox 
Author Message
 Refer to Me![control-name] in MsgBox

In Ac97, I am using the following to show that a budget transfer has
been completed from one account to another. The controls contain the
account names which are text.

MsgBox "Transfer completed from: " & chr(34) Me![From_account] & chr(34)
& " to: " & chr(34) Me![To_Account] chr(34) & ", ,"TRANSFER COMPLETE"

I am getting a compile error and do not understand why.

Any ideas, please?



Tue, 05 Jul 2005 04:19:53 GMT  
 Refer to Me![control-name] in MsgBox
Well, if you copied that directly, I would say you are missing a couple of
ampersands around Me![ToAccount] and one before ME![From_Account].

MsgBox "Transfer completed from: " & chr(34) &  Me![From_account] & chr(34)
 & " to: " & chr(34) & Me![To_Account] & chr(34) & ", ,"TRANSFER COMPLETE"

Quote:

> In Ac97, I am using the following to show that a budget transfer has
> been completed from one account to another. The controls contain the
> account names which are text.

> MsgBox "Transfer completed from: " & chr(34) Me![From_account] & chr(34)
> & " to: " & chr(34) Me![To_Account] chr(34) & ", ,"TRANSFER COMPLETE"

> I am getting a compile error and do not understand why.

> Any ideas, please?



Tue, 05 Jul 2005 04:21:27 GMT  
 Refer to Me![control-name] in MsgBox
Thanks John,

Your suggestion did not work either but I played around a bit and came up with
this one that did work.

MsgBox "Transfer completed from: " & Chr(34) & Me![From_account] & Chr(34) & "
and Transfer completed to: " & Chr(34) & Me![To_account] & """", , "TRANSFER
COMPLETE"

I don't know why but I have only been a programmer for 34 years so some things
are still a little tough to understand.

Thanks for the help.

Norm

Quote:

> Well, if you copied that directly, I would say you are missing a couple of
> ampersands around Me![ToAccount] and one before ME![From_Account].

> MsgBox "Transfer completed from: " & chr(34) &  Me![From_account] & chr(34)
>  & " to: " & chr(34) & Me![To_Account] & chr(34) & ", ,"TRANSFER COMPLETE"


> > In Ac97, I am using the following to show that a budget transfer has
> > been completed from one account to another. The controls contain the
> > account names which are text.

> > MsgBox "Transfer completed from: " & chr(34) Me![From_account] & chr(34)
> > & " to: " & chr(34) Me![To_Account] chr(34) & ", ,"TRANSFER COMPLETE"

> > I am getting a compile error and do not understand why.

> > Any ideas, please?



Tue, 05 Jul 2005 05:03:54 GMT  
 Refer to Me![control-name] in MsgBox

Quote:
> I don't know why but I have only been a programmer for 34 years so some
things
> are still a little tough to understand.

*Only* 34 years?!! With that kind of experience, it's likely that it's what you
need to forget that makes things a little tough to understand.    <g>
--
Bruce M. Thompson, Microsoft Access MVP

Quote:
>>No Email, Please. Keep all communications

    within the newsgroups so that all might benefit.<<


Tue, 05 Jul 2005 05:54:21 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Referring to a control by a generic name

2. Referring to Field Names with Variables

3. How to refer to current form item name?

4. Finding referring page name?

5. Can I refer forms by name ?

6. How do I refer to VB objects by name

7. Load a form by referring to it by it's string name

8. Referring to named objects

9. referring to a form by name

10. Referring to field whose name is a reserved word

11. referring to a form by name

12. Using variable to refer to variable name?

 

 
Powered by phpBB® Forum Software