Field name and Concatenate

  • Thread starter Thread starter Paul
  • Start date Start date
P

Paul

Please could you look at the following discusstion I had
woth somebody which was discontinuted.

I dont understand what is asked with the field name being
passed over and the concatenation. If you could list an
example please, it would be greatly appreciated. I bit
off a bit more than I could chew, and when I understnad
this, I'll be in the clear.

Thankx

Paul
-----Original Message-----
DoCmd.OpenForm stDocName2,,,"[FieldName]=" & MemberVar

You need to pass the field name also and concatenate in the value of
MemberVar. The above will work if MemberVar is a
number,
if it is text try:
DoCmd.OpenForm stDocName2,,,"[FieldName]='" & MemberVar & "'"

This will work as long as there are no values that have apostrophes (i.e.
O'Rielly) in them. If there are, let me know and I'll change it to work with
that.

This is being passed as the WhereCondition. Note the commas as place holders
for the unused options prior to the last used one.

--
Wayne Morgan
Microsoft Access MVP


I need to, with VB code, open a form and display a
specific record.

For a test example, I am have a variable
called "MemberVar" and would like to open a form using
the variable.

I already hae the following which dont work:

DoCmd.OpenForm stDocName2, , MemberVal, MemberVal

"StDocName2" represents the name of the form I want to
open.
I put "MemberVar" in twice because I dont know if they
are or are not suppsoed to be in or either.

As you can see, Im quite stupid, and a little light on
this matter would be greatly appreciated. Thnakx

Paul
 
Paul, the previous discussion wasn't "discontinued". This isn't "live chat".
My previous answer was done during a break at work. I replied again when I
got home from work.

--
Wayne Morgan
Microsoft Access MVP


Paul said:
Please could you look at the following discusstion I had
woth somebody which was discontinuted.

I dont understand what is asked with the field name being
passed over and the concatenation. If you could list an
example please, it would be greatly appreciated. I bit
off a bit more than I could chew, and when I understnad
this, I'll be in the clear.

Thankx

Paul
-----Original Message-----
DoCmd.OpenForm stDocName2,,,"[FieldName]=" & MemberVar

You need to pass the field name also and concatenate in the value of
MemberVar. The above will work if MemberVar is a
number,
if it is text try:
DoCmd.OpenForm stDocName2,,,"[FieldName]='" & MemberVar & "'"

This will work as long as there are no values that have apostrophes (i.e.
O'Rielly) in them. If there are, let me know and I'll change it to work with
that.

This is being passed as the WhereCondition. Note the commas as place holders
for the unused options prior to the last used one.

--
Wayne Morgan
Microsoft Access MVP


I need to, with VB code, open a form and display a
specific record.

For a test example, I am have a variable
called "MemberVar" and would like to open a form using
the variable.

I already hae the following which dont work:

DoCmd.OpenForm stDocName2, , MemberVal, MemberVal

"StDocName2" represents the name of the form I want to
open.
I put "MemberVar" in twice because I dont know if they
are or are not suppsoed to be in or either.

As you can see, Im quite stupid, and a little light on
this matter would be greatly appreciated. Thnakx

Paul
 
Then I apologise for being impatient. Usually I get
replies very quickly. This is not the point though. The
last 3 times I replied to a post, people did not
continue. I apologise about it looking like you was being
ignorant. It was just this matter needed answering
urgently. I just could not understand what you mentioned,
and after a couple of hours - I thought of reposting it.
-----Original Message-----
Paul, the previous discussion wasn't "discontinued". This isn't "live chat".
My previous answer was done during a break at work. I replied again when I
got home from work.

--
Wayne Morgan
Microsoft Access MVP


Please could you look at the following discusstion I had
woth somebody which was discontinuted.

I dont understand what is asked with the field name being
passed over and the concatenation. If you could list an
example please, it would be greatly appreciated. I bit
off a bit more than I could chew, and when I understnad
this, I'll be in the clear.

Thankx

Paul
-----Original Message-----
DoCmd.OpenForm stDocName2,,,"[FieldName]=" & MemberVar

You need to pass the field name also and concatenate in
the value of
MemberVar. The above will work if MemberVar is a number,
if it is text try:

DoCmd.OpenForm stDocName2,,,"[FieldName]='" & MemberVar
& "'"

This will work as long as there are no values that have
apostrophes (i.e.
O'Rielly) in them. If there are, let me know and I'll
change it to work with
that.

This is being passed as the WhereCondition. Note the
commas as place holders
for the unused options prior to the last used one.

--
Wayne Morgan
Microsoft Access MVP


message
I need to, with VB code, open a form and display a
specific record.

For a test example, I am have a variable
called "MemberVar" and would like to open a form using
the variable.

I already hae the following which dont work:

DoCmd.OpenForm stDocName2, , MemberVal, MemberVal

"StDocName2" represents the name of the form I want to
open.
I put "MemberVar" in twice because I dont know if they
are or are not suppsoed to be in or either.

As you can see, Im quite stupid, and a little light on
this matter would be greatly appreciated. Thnakx

Paul


.
 
Back
Top