Group:  Microsoft Access ยป microsoft.public.access.formscoding
Thread: Update a table with 2 concatenated fileds

DotNetBag
.NET Development Newsgroups

HTVi
TV Discussion Newsgroups

Our Hot Pick: Rising Antivirus 2006 - Certified by TUV & Checkmark! Get 10% discount by entering this coupon code: ONDISCOUNT10
Rising Antivirus 2006

Update a table with 2 concatenated fileds
beavetoots 29.09.2006 19:27:01
I have a form that has a club and a branch. I don't want to have users
having to data enter the combined field:
frm_data!combo_field = rtrim([club]) & Rtrim([branch])

I can get it to show the combined field in the form, but can't get it to
write back to the table that the form is based on:

tblZip.comboKey = Forms!frm_data!combo_field

Can somebody tell me how to get this to update the table?
Re: Update a table with 2 concatenated fileds
fredg <fgutkind[ at ]example.invalid> 29.09.2006 19:33:30
On Fri, 29 Sep 2006 12:27:01 -0700, beavetoots wrote:

[Quoted Text]
> I have a form that has a club and a branch. I don't want to have users
> having to data enter the combined field:
> frm_data!combo_field = rtrim([club]) & Rtrim([branch])
>
> I can get it to show the combined field in the form, but can't get it to
> write back to the table that the form is based on:
>
> tblZip.comboKey = Forms!frm_data!combo_field
>
> Can somebody tell me how to get this to update the table?

Don't.
Keep the data in 2 separate fields.
Anytime you need the combined data, combine it, in a query, form, or
report, using the same expression you are now using:
=rtrim([club]) & Rtrim([branch])
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
Re: Update a table with 2 concatenated fileds
beavetoots 29.09.2006 19:52:01
well ... I tried putting that in as a default field .... it wouldn't really
do anything ...
what I ended up doing was this:

Private Sub Branch_Exit(Cancel As Integer)
Dim ComboKey As String
ComboKey = (RTrim([Club]) & RTrim([Branch]))
Forms!ziptable!CombinedKey = ComboKey
End Sub



"fredg" wrote:

[Quoted Text]
> On Fri, 29 Sep 2006 12:27:01 -0700, beavetoots wrote:
>
> > I have a form that has a club and a branch. I don't want to have users
> > having to data enter the combined field:
> > frm_data!combo_field = rtrim([club]) & Rtrim([branch])
> >
> > I can get it to show the combined field in the form, but can't get it to
> > write back to the table that the form is based on:
> >
> > tblZip.comboKey = Forms!frm_data!combo_field
> >
> > Can somebody tell me how to get this to update the table?
>
> Don't.
> Keep the data in 2 separate fields.
> Anytime you need the combined data, combine it, in a query, form, or
> report, using the same expression you are now using:
> =rtrim([club]) & Rtrim([branch])
> --
> Fred
> Please respond only to this newsgroup.
> I do not reply to personal e-mail
>
Re: Update a table with 2 concatenated fileds
John Vinson <jvinson[ at ]STOP_SPAM.WysardOfInfo.com> 29.09.2006 23:19:51
On Fri, 29 Sep 2006 12:27:01 -0700, beavetoots
<beavetoots[ at ]discussions.microsoft.com> wrote:

[Quoted Text]
>I have a form that has a club and a branch. I don't want to have users
>having to data enter the combined field:
>frm_data!combo_field = rtrim([club]) & Rtrim([branch])
>
>I can get it to show the combined field in the form, but can't get it to
>write back to the table that the form is based on:
>
>tblZip.comboKey = Forms!frm_data!combo_field
>
>Can somebody tell me how to get this to update the table?

If you're trying to store a combined key, redundantly... DON'T. It's
neither necessary nor good practice!

The table should NOT HAVE a field named comboKey if it also has fields
Club and Branch. The field should simply *not exist*. If the
combination of the two fields is a primary key, simply select both
fields in table design view and click the Key icon to make them a
joint, two-field key.

John W. Vinson[MVP]

Home | Search | Terms | Imprint | Contact
Newsgroups Reader - provided by WiredBox.Net