By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,950 Members | 1,005 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,950 IT Pros & Developers. It's quick & easy.

Changing Unbound Field Name

P: n/a
Hi
I seem to be getting nowhere with this. I am opening a form which will
be used to input Notes into different fields in a table. My problem is
changing the unbound field name to the field name in the associated table
that this form is based on.
Is there anyway I can do this with vba ? I am using a different button
object to open this form for the field it is to update.

button1 updates unbound field name from text1 to 101Commnets
button2 updates field name from text1 to 102Comments
etc
I have just realised that I will have to return the field name back to text1
again on completion of task

Thanks in advance for any help at all

Dave
Nov 13 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
Can I ask "Why?" What you're describing doesn't sound like a particular
useful thing to do!

All you have to do is open the form in design mode, and change the Name
property of the control. Note that this means you can't do it from within
the form, but from another form.

DoCmd.OpenForm "MyOtherForm", acDesign
Forms("MyOtherForm").Controls("Text1").Name = "101Comments"
DoCmd.Close acForm, "MyOtherForm", acSaveYes

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

"David" <da***********@btinternet.com> wrote in message
news:d8**********@nwrdmz03.dmz.ncs.ea.ibs-infra.bt.com...
Hi
I seem to be getting nowhere with this. I am opening a form which will
be used to input Notes into different fields in a table. My problem is
changing the unbound field name to the field name in the associated table
that this form is based on.
Is there anyway I can do this with vba ? I am using a different button
object to open this form for the field it is to update.

button1 updates unbound field name from text1 to 101Commnets
button2 updates field name from text1 to 102Comments
etc
I have just realised that I will have to return the field name back to
text1 again on completion of task

Thanks in advance for any help at all

Dave

Nov 13 '05 #2

P: n/a
Doug

The reason for this is that I have had to create a form with a set of 80
date fields x 2 and also I need a notes field for each pair of date fields.
With the other fields required and the number of records possibly growing to
a couple of thousand I split the 3 fields into different tables. The notes
table therefore has 80 memo fields x possibly 2000 records.

I thought this was the way to go since I would have exceeded the number of
allowed fields in one table. Its been a headache from the start and I am
wondering now if I have done the right thing

Thanks

Dave

"Douglas J. Steele" <NOSPAM_djsteele@NOSPAM_canada.com> wrote in message
news:DI********************@rogers.com...
Can I ask "Why?" What you're describing doesn't sound like a particular
useful thing to do!

All you have to do is open the form in design mode, and change the Name
property of the control. Note that this means you can't do it from within
the form, but from another form.

DoCmd.OpenForm "MyOtherForm", acDesign
Forms("MyOtherForm").Controls("Text1").Name = "101Comments"
DoCmd.Close acForm, "MyOtherForm", acSaveYes

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

"David" <da***********@btinternet.com> wrote in message
news:d8**********@nwrdmz03.dmz.ncs.ea.ibs-infra.bt.com...
Hi
I seem to be getting nowhere with this. I am opening a form which will
be used to input Notes into different fields in a table. My problem is
changing the unbound field name to the field name in the associated table
that this form is based on.
Is there anyway I can do this with vba ? I am using a different button
object to open this form for the field it is to update.

button1 updates unbound field name from text1 to 101Commnets
button2 updates field name from text1 to 102Comments
etc
I have just realised that I will have to return the field name back to
text1 again on completion of task

Thanks in advance for any help at all

Dave


Nov 13 '05 #3

P: n/a
Doug
This worked in changing the field name but it was the control name that
I wanted to change, sorry my mistake.
Thanks for your help
Dave

"Douglas J. Steele" <NOSPAM_djsteele@NOSPAM_canada.com> wrote in message
news:DI********************@rogers.com...
Can I ask "Why?" What you're describing doesn't sound like a particular
useful thing to do!

All you have to do is open the form in design mode, and change the Name
property of the control. Note that this means you can't do it from within
the form, but from another form.

DoCmd.OpenForm "MyOtherForm", acDesign
Forms("MyOtherForm").Controls("Text1").Name = "101Comments"
DoCmd.Close acForm, "MyOtherForm", acSaveYes

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

"David" <da***********@btinternet.com> wrote in message
news:d8**********@nwrdmz03.dmz.ncs.ea.ibs-infra.bt.com...
Hi
I seem to be getting nowhere with this. I am opening a form which will
be used to input Notes into different fields in a table. My problem is
changing the unbound field name to the field name in the associated table
that this form is based on.
Is there anyway I can do this with vba ? I am using a different button
object to open this form for the field it is to update.

button1 updates unbound field name from text1 to 101Commnets
button2 updates field name from text1 to 102Comments
etc
I have just realised that I will have to return the field name back to
text1 again on completion of task

Thanks in advance for any help at all

Dave


Nov 13 '05 #4

P: n/a
My code changes the name of the control:

Forms("MyOtherForm").Controls("Text1").Name = "101Comments"

Are you saying that you want to bind the control to a different field? To do
that, you'd set the control's ControlSource, not its Name.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

"David" <da***********@btinternet.com> wrote in message
news:d8**********@nwrdmz03.dmz.ncs.ea.ibs-infra.bt.com...
Doug
This worked in changing the field name but it was the control name that
I wanted to change, sorry my mistake.
Thanks for your help
Dave

"Douglas J. Steele" <NOSPAM_djsteele@NOSPAM_canada.com> wrote in message
news:DI********************@rogers.com...
Can I ask "Why?" What you're describing doesn't sound like a particular
useful thing to do!

All you have to do is open the form in design mode, and change the Name
property of the control. Note that this means you can't do it from within
the form, but from another form.

DoCmd.OpenForm "MyOtherForm", acDesign
Forms("MyOtherForm").Controls("Text1").Name = "101Comments"
DoCmd.Close acForm, "MyOtherForm", acSaveYes

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

"David" <da***********@btinternet.com> wrote in message
news:d8**********@nwrdmz03.dmz.ncs.ea.ibs-infra.bt.com...
Hi
I seem to be getting nowhere with this. I am opening a form which
will be used to input Notes into different fields in a table. My problem
is changing the unbound field name to the field name in the associated
table that this form is based on.
Is there anyway I can do this with vba ? I am using a different
button object to open this form for the field it is to update.

button1 updates unbound field name from text1 to 101Commnets
button2 updates field name from text1 to 102Comments
etc
I have just realised that I will have to return the field name back to
text1 again on completion of task

Thanks in advance for any help at all

Dave



Nov 13 '05 #5

P: n/a
Thanks Doug it works fine now

Dave

"Douglas J. Steele" <NOSPAM_djsteele@NOSPAM_canada.com> wrote in message
news:Yb********************@rogers.com...
My code changes the name of the control:

Forms("MyOtherForm").Controls("Text1").Name = "101Comments"

Are you saying that you want to bind the control to a different field? To
do that, you'd set the control's ControlSource, not its Name.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

"David" <da***********@btinternet.com> wrote in message
news:d8**********@nwrdmz03.dmz.ncs.ea.ibs-infra.bt.com...
Doug
This worked in changing the field name but it was the control name
that I wanted to change, sorry my mistake.
Thanks for your help
Dave

"Douglas J. Steele" <NOSPAM_djsteele@NOSPAM_canada.com> wrote in message
news:DI********************@rogers.com...
Can I ask "Why?" What you're describing doesn't sound like a particular
useful thing to do!

All you have to do is open the form in design mode, and change the Name
property of the control. Note that this means you can't do it from
within the form, but from another form.

DoCmd.OpenForm "MyOtherForm", acDesign
Forms("MyOtherForm").Controls("Text1").Name = "101Comments"
DoCmd.Close acForm, "MyOtherForm", acSaveYes

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

"David" <da***********@btinternet.com> wrote in message
news:d8**********@nwrdmz03.dmz.ncs.ea.ibs-infra.bt.com...
Hi
I seem to be getting nowhere with this. I am opening a form which
will be used to input Notes into different fields in a table. My
problem is changing the unbound field name to the field name in the
associated table that this form is based on.
Is there anyway I can do this with vba ? I am using a different
button object to open this form for the field it is to update.

button1 updates unbound field name from text1 to 101Commnets
button2 updates field name from text1 to 102Comments
etc
I have just realised that I will have to return the field name back to
text1 again on completion of task

Thanks in advance for any help at all

Dave



Nov 13 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.