PC Review


Reply
Thread Tools Rate Thread

Copy Fields into other fields within the same form

 
 
=?Utf-8?B?cmF5bW9uZHA=?=
Guest
Posts: n/a
 
      9th Jul 2007
I have a combo box with 4 columns. I want to store the values in these
columns in the database. What I've been able to do is create additional text
boxes to return the columns using the expression, =SiteIDBox.column(1), and
so forth. In order to get it to work I had to put into the control source.
I tired in the default value but it didn't work there. Is there a way to get
that to work? If not, what I would like to do is create a button that will
copy the values from the fields with the expression to fields with the
appropriate control source within the same form so that the data is stored.
Any help would be great.
 
Reply With Quote
 
 
 
 
pietlinden@hotmail.com
Guest
Posts: n/a
 
      9th Jul 2007
On Jul 9, 3:04 pm, raymondp <raymo...@discussions.microsoft.com>
wrote:
> I have a combo box with 4 columns. I want to store the values in these
> columns in the database. What I've been able to do is create additional text
> boxes to return the columns using the expression, =SiteIDBox.column(1), and
> so forth. In order to get it to work I had to put into the control source.
> I tired in the default value but it didn't work there. Is there a way to get
> that to work? If not, what I would like to do is create a button that will
> copy the values from the fields with the expression to fields with the
> appropriate control source within the same form so that the data is stored.
> Any help would be great.


you just put the code in the afterupdate event of the combobox.
Me.txt1=me.cboX.Columns(0)
etc.

 
Reply With Quote
 
Larry Daugherty
Guest
Posts: n/a
 
      10th Jul 2007
Try turning your code "upside down" and put it into the AfterUpdate
event of the combobox. You've already figured out the harder part
which is getting the column index correctly.

HTH
--
-Larry-
--

"raymondp" <(E-Mail Removed)> wrote in message
news:C72284FA-3401-4C6F-B654-(E-Mail Removed)...
> I have a combo box with 4 columns. I want to store the values in

these
> columns in the database. What I've been able to do is create

additional text
> boxes to return the columns using the expression,

=SiteIDBox.column(1), and
> so forth. In order to get it to work I had to put into the control

source.
> I tired in the default value but it didn't work there. Is there a

way to get
> that to work? If not, what I would like to do is create a button

that will
> copy the values from the fields with the expression to fields with

the
> appropriate control source within the same form so that the data is

stored.
> Any help would be great.



 
Reply With Quote
 
=?Utf-8?B?cmF5bW9uZHA=?=
Guest
Posts: n/a
 
      10th Jul 2007
Larry, I'm confused by what you mean by turning the code "upside down."

When I tried to put the code Me.Text113=Me.cboSiteIDBox.column(1) into the
AfterUpdate event in the combo box, I get the following error,

"TAO Daily Log Database can't find the macro 'Me.'
The macro (or its macro group) doesn't exist, or the macro is new but hasn't
been saved.
Note that when you enter the macrogroupname.macroname syntax in an argument,
you must specify the name the macro's macro group was last saved under."

SiteIDBox is the name of the combo box that has the values I want to store.
Text113 is the name of the text box where I want to store the values.

Also, what is 'Me?'

"Larry Daugherty" wrote:

> Try turning your code "upside down" and put it into the AfterUpdate
> event of the combobox. You've already figured out the harder part
> which is getting the column index correctly.
>
> HTH
> --
> -Larry-
> --
>
> "raymondp" <(E-Mail Removed)> wrote in message
> news:C72284FA-3401-4C6F-B654-(E-Mail Removed)...
> > I have a combo box with 4 columns. I want to store the values in

> these
> > columns in the database. What I've been able to do is create

> additional text
> > boxes to return the columns using the expression,

> =SiteIDBox.column(1), and
> > so forth. In order to get it to work I had to put into the control

> source.
> > I tired in the default value but it didn't work there. Is there a

> way to get
> > that to work? If not, what I would like to do is create a button

> that will
> > copy the values from the fields with the expression to fields with

> the
> > appropriate control source within the same form so that the data is

> stored.
> > Any help would be great.

>
>
>

 
Reply With Quote
 
Larry Daugherty
Guest
Posts: n/a
 
      10th Jul 2007
While "turning the code upside down" is hardly correct terminology the
meaning was that instead of having the code say something equivalent
to change the code phrase from " Put the value you find over there (in
the cbo) over here (in the text control)" to "put the value you find
in this control and column(n) over in this text control". Sorry for
the confusion. You still seem to have gotten the correct idea.

"me" refers to the Form or Report where the code is executing..

putting the line of code

Me!Text113 = Me!cboSiteIDBox.column(1)

into the AfterUpdate event of cboSiteIDBox would cause the value in
the 2nd column of the combobox - to be placed in the textbox control
named Text113 on the currently running Form.

HTH
-Larry-
--

"raymondp" <(E-Mail Removed)> wrote in message
news:503FF1D3-8ECE-4E7E-B10E-(E-Mail Removed)...
> Larry, I'm confused by what you mean by turning the code "upside

down."
>
> When I tried to put the code Me.Text113=Me.cboSiteIDBox.column(1)

into the
> AfterUpdate event in the combo box, I get the following error,
>
> "TAO Daily Log Database can't find the macro 'Me.'
> The macro (or its macro group) doesn't exist, or the macro is new

but hasn't
> been saved.
> Note that when you enter the macrogroupname.macroname syntax in an

argument,
> you must specify the name the macro's macro group was last saved

under."
>
> SiteIDBox is the name of the combo box that has the values I want to

store.
> Text113 is the name of the text box where I want to store the

values.
>
> Also, what is 'Me?'
>
> "Larry Daugherty" wrote:
>
> > Try turning your code "upside down" and put it into the

AfterUpdate
> > event of the combobox. You've already figured out the harder part
> > which is getting the column index correctly.
> >
> > HTH
> > --
> > -Larry-
> > --
> >
> > "raymondp" <(E-Mail Removed)> wrote in message
> > news:C72284FA-3401-4C6F-B654-(E-Mail Removed)...
> > > I have a combo box with 4 columns. I want to store the values

in
> > these
> > > columns in the database. What I've been able to do is create

> > additional text
> > > boxes to return the columns using the expression,

> > =SiteIDBox.column(1), and
> > > so forth. In order to get it to work I had to put into the

control
> > source.
> > > I tired in the default value but it didn't work there. Is there

a
> > way to get
> > > that to work? If not, what I would like to do is create a

button
> > that will
> > > copy the values from the fields with the expression to fields

with
> > the
> > > appropriate control source within the same form so that the data

is
> > stored.
> > > Any help would be great.

> >
> >
> >



 
Reply With Quote
 
=?Utf-8?B?cmF5bW9uZHA=?=
Guest
Posts: n/a
 
      10th Jul 2007
Thanks for clearing that up for me.

I put in the code

Me!Text113 = Me!cboSiteIDBox.column(1)

into the AfterUpdate event in the combo box, but I still got the error I
mentioned before (Macro doesn't exist and so forth).
What am I doing wrong? Or what haven't I done yet that I need to do to get
this to work? This is driving me nuts.


"Larry Daugherty" wrote:

> While "turning the code upside down" is hardly correct terminology the
> meaning was that instead of having the code say something equivalent
> to change the code phrase from " Put the value you find over there (in
> the cbo) over here (in the text control)" to "put the value you find
> in this control and column(n) over in this text control". Sorry for
> the confusion. You still seem to have gotten the correct idea.
>
> "me" refers to the Form or Report where the code is executing..
>
> putting the line of code
>
> Me!Text113 = Me!cboSiteIDBox.column(1)
>
> into the AfterUpdate event of cboSiteIDBox would cause the value in
> the 2nd column of the combobox - to be placed in the textbox control
> named Text113 on the currently running Form.
>
> HTH
> -Larry-
> --
>
> "raymondp" <(E-Mail Removed)> wrote in message
> news:503FF1D3-8ECE-4E7E-B10E-(E-Mail Removed)...
> > Larry, I'm confused by what you mean by turning the code "upside

> down."
> >
> > When I tried to put the code Me.Text113=Me.cboSiteIDBox.column(1)

> into the
> > AfterUpdate event in the combo box, I get the following error,
> >
> > "TAO Daily Log Database can't find the macro 'Me.'
> > The macro (or its macro group) doesn't exist, or the macro is new

> but hasn't
> > been saved.
> > Note that when you enter the macrogroupname.macroname syntax in an

> argument,
> > you must specify the name the macro's macro group was last saved

> under."
> >
> > SiteIDBox is the name of the combo box that has the values I want to

> store.
> > Text113 is the name of the text box where I want to store the

> values.
> >
> > Also, what is 'Me?'
> >
> > "Larry Daugherty" wrote:
> >
> > > Try turning your code "upside down" and put it into the

> AfterUpdate
> > > event of the combobox. You've already figured out the harder part
> > > which is getting the column index correctly.
> > >
> > > HTH
> > > --
> > > -Larry-
> > > --
> > >
> > > "raymondp" <(E-Mail Removed)> wrote in message
> > > news:C72284FA-3401-4C6F-B654-(E-Mail Removed)...
> > > > I have a combo box with 4 columns. I want to store the values

> in
> > > these
> > > > columns in the database. What I've been able to do is create
> > > additional text
> > > > boxes to return the columns using the expression,
> > > =SiteIDBox.column(1), and
> > > > so forth. In order to get it to work I had to put into the

> control
> > > source.
> > > > I tired in the default value but it didn't work there. Is there

> a
> > > way to get
> > > > that to work? If not, what I would like to do is create a

> button
> > > that will
> > > > copy the values from the fields with the expression to fields

> with
> > > the
> > > > appropriate control source within the same form so that the data

> is
> > > stored.
> > > > Any help would be great.
> > >
> > >
> > >

>
>
>

 
Reply With Quote
 
Larry Daugherty
Guest
Posts: n/a
 
      11th Jul 2007
I haven't got a clue. If I had your stuff on my system I'd be better
able to analyze and debug it. Are you single stepping in the
AfterUpdate event? Are you sure that the line in question is the one
causing the error?

--
-Larry-
--

"raymondp" <(E-Mail Removed)> wrote in message
news:A33857F7-9EA5-4E83-9D5D-(E-Mail Removed)...
> Thanks for clearing that up for me.
>
> I put in the code
>
> Me!Text113 = Me!cboSiteIDBox.column(1)
>
> into the AfterUpdate event in the combo box, but I still got the

error I
> mentioned before (Macro doesn't exist and so forth).
> What am I doing wrong? Or what haven't I done yet that I need to do

to get
> this to work? This is driving me nuts.
>
>
> "Larry Daugherty" wrote:
>
> > While "turning the code upside down" is hardly correct terminology

the
> > meaning was that instead of having the code say something

equivalent
> > to change the code phrase from " Put the value you find over there

(in
> > the cbo) over here (in the text control)" to "put the value you

find
> > in this control and column(n) over in this text control". Sorry

for
> > the confusion. You still seem to have gotten the correct idea.
> >
> > "me" refers to the Form or Report where the code is executing..
> >
> > putting the line of code
> >
> > Me!Text113 = Me!cboSiteIDBox.column(1)
> >
> > into the AfterUpdate event of cboSiteIDBox would cause the value

in
> > the 2nd column of the combobox - to be placed in the textbox

control
> > named Text113 on the currently running Form.
> >
> > HTH
> > -Larry-
> > --
> >
> > "raymondp" <(E-Mail Removed)> wrote in message
> > news:503FF1D3-8ECE-4E7E-B10E-(E-Mail Removed)...
> > > Larry, I'm confused by what you mean by turning the code "upside

> > down."
> > >
> > > When I tried to put the code

Me.Text113=Me.cboSiteIDBox.column(1)
> > into the
> > > AfterUpdate event in the combo box, I get the following error,
> > >
> > > "TAO Daily Log Database can't find the macro 'Me.'
> > > The macro (or its macro group) doesn't exist, or the macro is

new
> > but hasn't
> > > been saved.
> > > Note that when you enter the macrogroupname.macroname syntax in

an
> > argument,
> > > you must specify the name the macro's macro group was last saved

> > under."
> > >
> > > SiteIDBox is the name of the combo box that has the values I

want to
> > store.
> > > Text113 is the name of the text box where I want to store the

> > values.
> > >
> > > Also, what is 'Me?'
> > >
> > > "Larry Daugherty" wrote:
> > >
> > > > Try turning your code "upside down" and put it into the

> > AfterUpdate
> > > > event of the combobox. You've already figured out the harder

part
> > > > which is getting the column index correctly.
> > > >
> > > > HTH
> > > > --
> > > > -Larry-
> > > > --
> > > >
> > > > "raymondp" <(E-Mail Removed)> wrote in

message
> > > > news:C72284FA-3401-4C6F-B654-(E-Mail Removed)...
> > > > > I have a combo box with 4 columns. I want to store the

values
> > in
> > > > these
> > > > > columns in the database. What I've been able to do is

create
> > > > additional text
> > > > > boxes to return the columns using the expression,
> > > > =SiteIDBox.column(1), and
> > > > > so forth. In order to get it to work I had to put into the

> > control
> > > > source.
> > > > > I tired in the default value but it didn't work there. Is

there
> > a
> > > > way to get
> > > > > that to work? If not, what I would like to do is create a

> > button
> > > > that will
> > > > > copy the values from the fields with the expression to

fields
> > with
> > > > the
> > > > > appropriate control source within the same form so that the

data
> > is
> > > > stored.
> > > > > Any help would be great.
> > > >
> > > >
> > > >

> >
> >
> >



 
Reply With Quote
 
=?Utf-8?B?cmF5bW9uZHA=?=
Guest
Posts: n/a
 
      11th Jul 2007
I'm a novice user of Access, so I'm not sure what you mean by single stepping
and I have no clue if the line in question is the one causing the error.
What about creating a button that will copy the values from one field into
other fields on the same form? Is this possible?
If you would like to debug what I'm doing, I can send you a copy of the
database I'm working with. If you don't want to put your email address on
this public site, you can send me an email at (E-Mail Removed).
I really appreciate the help you've given thus far. Thanks.

-Ray

"Larry Daugherty" wrote:

> I haven't got a clue. If I had your stuff on my system I'd be better
> able to analyze and debug it. Are you single stepping in the
> AfterUpdate event? Are you sure that the line in question is the one
> causing the error?
>
> --
> -Larry-
> --
>


 
Reply With Quote
 
=?Utf-8?B?cmF5bW9uZHA=?=
Guest
Posts: n/a
 
      11th Jul 2007
Thanks again for your help, but I figured out how to fill in the values
through a series of RunCommand macros.

"raymondp" wrote:

> I'm a novice user of Access, so I'm not sure what you mean by single stepping
> and I have no clue if the line in question is the one causing the error.
> What about creating a button that will copy the values from one field into
> other fields on the same form? Is this possible?
> If you would like to debug what I'm doing, I can send you a copy of the
> database I'm working with. If you don't want to put your email address on
> this public site, you can send me an email at (E-Mail Removed).
> I really appreciate the help you've given thus far. Thanks.
>
> -Ray
>
> "Larry Daugherty" wrote:
>
> > I haven't got a clue. If I had your stuff on my system I'd be better
> > able to analyze and debug it. Are you single stepping in the
> > AfterUpdate event? Are you sure that the line in question is the one
> > causing the error?
> >
> > --
> > -Larry-
> > --
> >

>

 
Reply With Quote
 
Larry Daugherty
Guest
Posts: n/a
 
      12th Jul 2007
Hi Ray,

You were using the word "Macro" correctly as it applies to Access.
Many people use that word to mean VBA code in Access because that's
the term used in the other office applications.

For the reasons you were experiencing, among others, experienced
developers don't use macros. They use VBA. It is impossible to
single step or make any other use of the debugger when running Access
Macros. If you intend to develop in Access I recommend that you bite
the bullet and learn how to use VBA - sooner is better than later.
There is a tool to convert Access macros to VBA. Once that's done you
should use VBA exclusively except in those very few special cases
where you can't. You can do things with VBA that you can't with
macros.

HTH
--
-Larry-
--

"raymondp" <(E-Mail Removed)> wrote in message
news:47CCA5DA-0B99-4579-9204-(E-Mail Removed)...
> Thanks again for your help, but I figured out how to fill in the

values
> through a series of RunCommand macros.
>
> "raymondp" wrote:
>
> > I'm a novice user of Access, so I'm not sure what you mean by

single stepping
> > and I have no clue if the line in question is the one causing the

error.
> > What about creating a button that will copy the values from one

field into
> > other fields on the same form? Is this possible?
> > If you would like to debug what I'm doing, I can send you a copy

of the
> > database I'm working with. If you don't want to put your email

address on
> > this public site, you can send me an email at (E-Mail Removed).
> > I really appreciate the help you've given thus far. Thanks.
> >
> > -Ray
> >
> > "Larry Daugherty" wrote:
> >
> > > I haven't got a clue. If I had your stuff on my system I'd be

better
> > > able to analyze and debug it. Are you single stepping in the
> > > AfterUpdate event? Are you sure that the line in question is

the one
> > > causing the error?
> > >
> > > --
> > > -Larry-
> > > --
> > >

> >



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy 2 fields from subform into new form Charlie Microsoft Access Form Coding 1 28th Feb 2010 01:32 AM
Form fields and copy paste =?Utf-8?B?QWxsaXNvbg==?= Microsoft Word Document Management 9 27th Apr 2007 02:30 AM
Why can't I just copy a form and edit the fields? SteveC Microsoft Access Getting Started 7 5th Jul 2006 04:00 PM
ALIGNMENT OF FORM FIELDS - I am using FrongPage 2002 - How do I lineup fields on a form? Marcello do Guzman Microsoft Frontpage 1 2nd Mar 2005 11:36 PM
Creating Form Fields that copy other Form Fields =?Utf-8?B?Um9iZXJ0IEw=?= Microsoft Word New Users 2 14th Jan 2004 09:15 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:23 AM.