473,387 Members | 1,641 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Assistance needed with a small piece of code

I just need a small mod to my code (I think) to get the result I want.
Earlier this week I had received help from FredG on concatenating a field in
a form. I went on to create a field in the form to collect the temporary
concatenation and store it to the underlying table. I am certain that this
breaks a few rules of good database practices, but believe me, it was
necessary.

What I am trying to accomplish now is test one of the two fields I wish to
concatenate to see if it is Null or not, and based upon the result either
store just one field (NewLongDescription in the instance where the other
field (DefaultHairColor) is Null) or store the concatenated field (when
DefaultHairColor is not Null). Below is what I tried to use to accomplish
this. My coding abilities are rather weak, so you might see a fundemantal
flaw in what I have written. If not, read further for additional background.

Private Sub NewLongDescription_LostFocus()

If Me!DefaultHairColor IsNull Then

Me!NewLongDescription.Requery

Me![LongDescription] = Me![NewLongDescription]

Else

Me!NewLongDescription.Requery

Me![LongDescription] = Me![ConcatDescript]

End If

End Sub

Under the direction of FredG in this Newsgroup, I created an unbound
calculating form field with the expression:

=[NewLongDescription] & " " & "Stock Hair Color (if any): " &
[DefaultHairColor]

I was able to make a calculated (concatenated) field. In my application I
really needed to make this calculated field a field that would be recorded
to the underlying table. With some minor coding, I was able to accomplish
this. I realize that in most circumstances this is probably not the proper
way to build a database, but honestly, it was appropriate in this case.

If you are interested, here is what I did:

When either NewLongDescription or DefaultHairColor lost focus, the following
now occurs:

Private Sub DefaultHairColor_LostFocus()
Me!DefaultHairColor.Requery
Me![LongDescription] = Me![ConcatDescript]
End Sub

Private Sub NewLongDescription_LostFocus()
Me!NewLongDescription.Requery
Me![LongDescription] = Me![ConcatDescript]
End Sub

The result is that the calculated (unbound) field (ConcatDescript) gets
loaded into a bound field called LongDescription when either of the two user
entry fields lose focus after an update (NewLongDescription
orDefaultHairColor). Bottom line is that it works thus far (is loaded into
the underlying table). Now I want the concatenation to take place only if
DefaultHairColor is not Null.

Thanks again for any input from this group!
~Bruce

Nov 12 '05 #1
18 1536
"B Love" <bl*******@charter.net> wrote in
news:vu************@corp.supernews.com:

If Me!DefaultHairColor IsNull Then


probably IsDull(Me!DefaultHairColor)

--
Lyle
(for e-mail refer to http://ffdba.com/contacts.htm)
Nov 12 '05 #2
Lyle,

Thanks! That did the Trick (except for the IsDull comment!). Specifically,
I used:

If IsNull(Me!DefaultHairColor) Then ..............

Again, thanks so much! It works great now!
~Bruce
"Lyle Fairfield" <Mi************@Invalid.Com> wrote in message
news:Xn*******************@130.133.1.4...
"B Love" <bl*******@charter.net> wrote in
news:vu************@corp.supernews.com:

If Me!DefaultHairColor IsNull Then


probably IsDull(Me!DefaultHairColor)

--
Lyle
(for e-mail refer to http://ffdba.com/contacts.htm)

Nov 12 '05 #3
DFS
"Lyle Fairfield" <Mi************@Invalid.Com> wrote in message
news:Xn*******************@130.133.1.4...
"B Love" <bl*******@charter.net> wrote in
news:vu************@corp.supernews.com:

If Me!DefaultHairColor IsNull Then


probably IsDull(Me!DefaultHairColor)

You Britishers... such cheeky chaps, what!


Nov 12 '05 #4
"DFS" <no****@nospam.com> wrote in news:vu************@corp.supernews.com:
"Lyle Fairfield" <Mi************@Invalid.Com> wrote in message
news:Xn*******************@130.133.1.4...
"B Love" <bl*******@charter.net> wrote in
news:vu************@corp.supernews.com:
> If Me!DefaultHairColor IsNull Then


probably IsDull(Me!DefaultHairColor)


You Britishers... such cheeky chaps, what!


O Canada! Terre de nos aïeux,
Ton front est ceint de fleurons glorieux!

Car ton bras sait porter l'épée,
Il sait porter la croix!

Ton histoire est une épopée
Des plus brillants exploits.

Et ta valeur, de foi trempée,
Protégera nos foyers et nos droits.

Protégera nos foyers et nos droits.

--
Lyle
(for e-mail refer to http://ffdba.com/contacts.htm)
Nov 12 '05 #5
"DFS" wrote
You Britishers... such cheeky chaps, what!


It'll be interesting to see Lyle's reply to this -- he's Canadian. I'm not
at all certain how Canadians view being called "Britishers".
Nov 12 '05 #6
DFS

"Larry Linson" <bo*****@localhost.not> wrote in message
news:RH*****************@nwrddc02.gnilink.net...
"DFS" wrote
> You Britishers... such cheeky chaps, what!


It'll be interesting to see Lyle's reply to this -- he's Canadian. I'm not
at all certain how Canadians view being called "Britishers".


Whoops. Can't remember why I thought he was from Merry Old...


Nov 12 '05 #7
DFS

"Lyle Fairfield" <Mi************@Invalid.Com> wrote in message
news:Xn******************@130.133.1.4...
"DFS" <no****@nospam.com> wrote in news:vu************@corp.supernews.com:
"Lyle Fairfield" <Mi************@Invalid.Com> wrote in message
news:Xn*******************@130.133.1.4...
"B Love" <bl*******@charter.net> wrote in
news:vu************@corp.supernews.com:

> If Me!DefaultHairColor IsNull Then

probably IsDull(Me!DefaultHairColor)


You Britishers... such cheeky chaps, what!


O Canada! Terre de nos aïeux,
Ton front est ceint de fleurons glorieux!

Car ton bras sait porter l'épée,
Il sait porter la croix!

Ton histoire est une épopée
Des plus brillants exploits.

Et ta valeur, de foi trempée,
Protégera nos foyers et nos droits.

Protégera nos foyers et nos droits.

Ah! A Canuck. My mistake. Here's a right pretty song you might have
heard...

O, I wish I was in the land of cotton
Old times there are not forgotten
Look away! Look away!
Look away! Dixie Land.

In Dixie Land where I was born in
Early on one frosty mornin'
Look away! Look away!
Look away! Dixie Land.

Chorus:
O, I wish I was in Dixie!
Hooray! Hooray!
In Dixie Land I'll take my stand
To live and die in Dixie
Away, away,
Away down south in Dixie!

Nov 12 '05 #8
Ah ha! I can put another push-pin in my map of Canadian "Access" people...

Greetings from Guelph (home) and Brantford (work)...

Fred Boer
"Lyle Fairfield" <Mi************@Invalid.Com> wrote in message
news:Xn******************@130.133.1.4...
"DFS" <no****@nospam.com> wrote in news:vu************@corp.supernews.com:
"Lyle Fairfield" <Mi************@Invalid.Com> wrote in message
news:Xn*******************@130.133.1.4...
"B Love" <bl*******@charter.net> wrote in
news:vu************@corp.supernews.com:

> If Me!DefaultHairColor IsNull Then

probably IsDull(Me!DefaultHairColor)


You Britishers... such cheeky chaps, what!


O Canada! Terre de nos aïeux,
Ton front est ceint de fleurons glorieux!

Car ton bras sait porter l'épée,
Il sait porter la croix!

Ton histoire est une épopée
Des plus brillants exploits.

Et ta valeur, de foi trempée,
Protégera nos foyers et nos droits.

Protégera nos foyers et nos droits.

--
Lyle
(for e-mail refer to http://ffdba.com/contacts.htm)

Nov 12 '05 #9
"Fred Boer" <fr*******@STOPyahooSPAM.com> wrote in
news:3f********@news.sentex.net:
Ah ha! I can put another push-pin in my map of Canadian
"Access" people...

Greetings from Guelph (home) and Brantford (work)...

Fred Boer

Pop one in to the westernmost tip of Montreal island. Label it with
my name.

Bob Quintal
Nov 12 '05 #10
Bonjour! Ok.. you get a blue push-pin!

Fred

"Bob Quintal" <bq******@generation.net> wrote in message
news:44******************************@news.teranew s.com...
"Fred Boer" <fr*******@STOPyahooSPAM.com> wrote in
news:3f********@news.sentex.net:
Ah ha! I can put another push-pin in my map of Canadian
"Access" people...

Greetings from Guelph (home) and Brantford (work)...

Fred Boer

Pop one in to the westernmost tip of Montreal island. Label it with
my name.

Bob Quintal

Nov 12 '05 #11
"DFS" <no****@nospam.com> wrote in message news:<vu************@corp.supernews.com>...
"Larry Linson" <bo*****@localhost.not> wrote in message
news:RH*****************@nwrddc02.gnilink.net...
"DFS" wrote
> You Britishers... such cheeky chaps, what!


It'll be interesting to see Lyle's reply to this -- he's Canadian. I'm not
at all certain how Canadians view being called "Britishers".


Whoops. Can't remember why I thought he was from Merry Old...


It's that whole vowel shift thing...

(Former Toronto Resident)
Nov 12 '05 #12
"Fred Boer" <fr*******@STOPyahooSPAM.com> wrote:
Bonjour! Ok.. you get a blue push-pin!


Can you put a small fleurs-de-lis on the head of the push pin? <smile>

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Nov 12 '05 #13
> >Bonjour! Ok.. you get a blue push-pin!

Can you put a small fleurs-de-lis on the head of the push pin? <smile>

Tony


It's a fleur de lys, moron.
Nov 12 '05 #14
th**********@yahoo.com (Alex) wrote:
>Bonjour! Ok.. you get a blue push-pin!
Can you put a small fleurs-de-lis on the head of the push pin? <smile>

It's a fleur de lys, moron.


http://www.premier.gouv.qc.ca/secteu...mblemes_en.htm
Under the section laballed flag it states " Its fleurs-de-lis pointed toward the
centre, recalling a flag said to have accompanied Montcalm's army during its victory
in 1758 over the British troops at Fort Carillon (now Ticonderoga, New York). "

What is more definitive that the website of the Premier of Quebec? Or am I missing
something?

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Nov 12 '05 #15
> What is more definitive that the website of the Premier of Quebec? Or am I missing
something?


The dictionary:

http://www.francophonie.hachette-liv...SCIP.LL0181400

"Fleur" is singular the way you phrased it. Moreover, your
hyphenation breaks all rules of the "trait d'union," namely, that the
French hyphen is only used within composed (compound) words, of which
Fleur de lys clearly ARE not.

The rule is exactly the same in English. Therefore, the site is
wrong. There is no Quebécois dictionary as of yet. Thinking the
premier is an authority in French is as moronic as thinking Bush to be
an authority in English.

Can you put a small fleurs-de-lis on the head of the push pin? <smile>

It's a fleur de lys, moron.


http://www.premier.gouv.qc.ca/secteu...mblemes_en.htm
Under the section laballed flag it states " Its fleurs-de-lis pointed toward the
centre, recalling a flag said to have accompanied Montcalm's army during its victory
in 1758 over the British troops at Fort Carillon (now Ticonderoga, New York). "

What is more definitive that the website of the Premier of Quebec? Or am I missing
something?

Tony

Nov 12 '05 #16
th**********@yahoo.com (Alex) wrote:
What is more definitive that the website of the Premier of Quebec? Or am I missing
something?


The dictionary:

http://www.francophonie.hachette-liv...SCIP.LL0181400

"Fleur" is singular the way you phrased it. Moreover, your
hyphenation breaks all rules of the "trait d'union," namely, that the
French hyphen is only used within composed (compound) words, of which
Fleur de lys clearly ARE not.

The rule is exactly the same in English. Therefore, the site is
wrong. There is no Quebécois dictionary as of yet. Thinking the
premier is an authority in French is as moronic as thinking Bush to be
an authority in English.


Ok, well that was the best authority I could think of. <shrug> I suggest you take
it up with the Premiers office then.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Nov 12 '05 #17
th**********@yahoo.com (Alex) wrote:
It's a fleur de lys, moron.


BTW you'd be a much better ambassador for the French language and culture if you were
a lot politer.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Nov 12 '05 #18
Tony Toews <tt****@telusplanet.net> wrote:
th**********@yahoo.com (Alex) wrote:
It's a fleur de lys, moron.


BTW you'd be a much better ambassador for the French language and culture if you were
a lot politer.


I should've said French language and Quebec culture.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Nov 12 '05 #19

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: RF Rohrer | last post by:
I am seeking assistance in the development of a J/S script that will, on OnClick browser action cause another, external piece of HTML code to be displayed near where the mouse was when OnClick was...
0
by: Richard Mathis | last post by:
My problem is rather complicated (for me), so I'm going to post my problem here as well as what I've done so far to solve my problem. Any assistance would be appreciated. I originally posted this...
2
by: Janus Knudsen | last post by:
Hello Im collecting ideas for a piece of software I've in mind. I need to create an application which can be started with some parameters, the application have to be started in many instances...
1
by: beagleears | last post by:
I have a piece of code in which I pass a function to a function and it works fine in stand alone code but when I encorporate it in a class my compiler tells me there is no matching function. The...
3
by: Oliver Marshall | last post by:
Hi chaps, I just need a widget of php if anyone has somethign similar to hand. I need to create a .php file that will take an input (&type=xxx or yyy), run a piece of javascript in the browser...
169
by: JohnQ | last post by:
(The "C++ Grammer" thread in comp.lang.c++.moderated prompted this post). It would be more than a little bit nice if C++ was much "cleaner" (less complex) so that it wasn't a major world wide...
3
by: =?Utf-8?B?Q2hyaXM=?= | last post by:
Hi, I need to store customers and their emails in an XML file for quick lookup in a small program. I am kind of a bit confused with this XML thing. Do I use XML or this XSD Schema? I came up...
9
by: OWeb | last post by:
Javascript and recursing subfolders assistance ------------------------- I have this script that is a free extra download from SlideShowPro. It's a great script but I feel it needs to be...
0
by: boblatest | last post by:
Hello, please accept my apologies for the OT posting. I've tried to get an answer over at www.authoring.misc but didn't. So I'm hoping that I'll get some input from this group from which I've...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.