473,399 Members | 4,192 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,399 software developers and data experts.

.Undo for unbound controls?

ARC
I've noticed that if you use code for the before update command for unbound
controls, it doesn't really work.

I tried the following:

Me!ExportedYN.undo
Cancel = True
DoCmd.CancelEvent
Exit Sub

However, putting the above code in the before update on unbound controls
does NOT undo their typing. Does anyone know the proper way for unbound
controls?

Many Thanks,
Jul 13 '07 #1
7 6756
"ARC" <an**@andyc.comwrote in
news:BY*******************@newssvr25.news.prodigy. net:
I've noticed that if you use code for the before update
command for unbound controls, it doesn't really work.

I tried the following:

Me!ExportedYN.undo
Cancel = True
DoCmd.CancelEvent
Exit Sub

However, putting the above code in the before update on
unbound controls does NOT undo their typing. Does anyone know
the proper way for unbound controls?

Many Thanks,
The reason is that the before update event may reject an entry
because of a spelling misteak and users get annoyed if they have
to retype the whole mistake instead of just editing the
previously typed data.

In addition to the Cancel = true statement,
put me.ExportedYN.text = ""
(I'm guessing that ExportedYN is your control name. .

--
Bob Quintal

PA is y I've altered my email address.

--
Posted via a free Usenet account from http://www.teranews.com

Jul 13 '07 #2
ARC
Yes, the ExportedYN is the control name, and it is a checkbox. I tried
setting it back to ExportedYN = 0, but it didn't work...
"Bob Quintal" <rq******@sPAmpatico.cawrote in message
news:Xn**********************@66.150.105.47...
"ARC" <an**@andyc.comwrote in
news:BY*******************@newssvr25.news.prodigy. net:
>I've noticed that if you use code for the before update
command for unbound controls, it doesn't really work.

I tried the following:

Me!ExportedYN.undo
Cancel = True
DoCmd.CancelEvent
Exit Sub

However, putting the above code in the before update on
unbound controls does NOT undo their typing. Does anyone know
the proper way for unbound controls?

Many Thanks,
The reason is that the before update event may reject an entry
because of a spelling misteak and users get annoyed if they have
to retype the whole mistake instead of just editing the
previously typed data.

In addition to the Cancel = true statement,
put me.ExportedYN.text = ""
(I'm guessing that ExportedYN is your control name. .

--
Bob Quintal

PA is y I've altered my email address.

--
Posted via a free Usenet account from http://www.teranews.com

Jul 13 '07 #3
"ARC" <an**@andyc.comwrote in
news:3G*******************@newssvr21.news.prodigy. net:
Yes, the ExportedYN is the control name, and it is a checkbox.
I tried setting it back to ExportedYN = 0, but it didn't
work...
Ok, I misinterpreted your statement about " before update on
unbound controls does NOT undo their typing." since you don't
type anything into a checkbox.

Maybe if I understood more about what triggers the need to undo
the checkbox I might be able to offer better suggestions.
>
"Bob Quintal" <rq******@sPAmpatico.cawrote in message
news:Xn**********************@66.150.105.47...
>"ARC" <an**@andyc.comwrote in
news:BY*******************@newssvr25.news.prodigy .net:
>>I've noticed that if you use code for the before update
command for unbound controls, it doesn't really work.

I tried the following:

Me!ExportedYN.undo
Cancel = True
DoCmd.CancelEvent
Exit Sub

However, putting the above code in the before update on
unbound controls does NOT undo their typing. Does anyone
know the proper way for unbound controls?

Many Thanks,
The reason is that the before update event may reject an
entry because of a spelling misteak and users get annoyed if
they have to retype the whole mistake instead of just editing
the previously typed data.

In addition to the Cancel = true statement,
put me.ExportedYN.text = ""
(I'm guessing that ExportedYN is your control name. .

--
Bob Quintal

PA is y I've altered my email address.

--
Posted via a free Usenet account from http://www.teranews.com




--
Bob Quintal

PA is y I've altered my email address.

--
Posted via a free Usenet account from http://www.teranews.com

Jul 13 '07 #4
ARC wrote:
>I've noticed that if you use code for the before update command for unbound
controls, it doesn't really work.

I tried the following:

Me!ExportedYN.undo
Cancel = True
DoCmd.CancelEvent
Exit Sub

However, putting the above code in the before update on unbound controls
does NOT undo their typing. Does anyone know the proper way for unbound
controls?

Unbound controls do not have a "previous" value (that is in
the original current record), so Undo is meaningless (in the
context of its definition).

Can't you use the AfterUpdate event and just set the value
to a known value?

Note that in your code above, Cancel = True and CancelEvent
are equivalent and using both is redundant. Cancel = True
is the recommended approach.

--
Marsh
Jul 13 '07 #5
ARC
Thanks to both of you!

The need to undo the checkbox is because I have the detail showing repeating
lines, so the repeating lines are bound controls. The form header controls
are all unbound, and I'm saving them via code (since I can't have 2 records
sources, I have to do unbound in for the header controls). The checkbox is a
Taxexempt switch that saves with the header area.

If you want more detail:

Header controls are for a table called Invoices which contain the main
options for the invoice, like date, invoice number, tax exempt (checkbox),
etc. I have them all unbound, and am saving the data manually via code.

Detail controls are bound and use the table InvoiceDetail.

Wish there was a way to do a different record source for the header and
details, but you can't.

Hope that makes more sense,

"Bob Quintal" <rq******@sPAmpatico.cawrote in message
news:Xn**********************@66.150.105.47...
"ARC" <an**@andyc.comwrote in
news:3G*******************@newssvr21.news.prodigy. net:
>Yes, the ExportedYN is the control name, and it is a checkbox.
I tried setting it back to ExportedYN = 0, but it didn't
work...
Ok, I misinterpreted your statement about " before update on
unbound controls does NOT undo their typing." since you don't
type anything into a checkbox.

Maybe if I understood more about what triggers the need to undo
the checkbox I might be able to offer better suggestions.
>>
"Bob Quintal" <rq******@sPAmpatico.cawrote in message
news:Xn**********************@66.150.105.47...
>>"ARC" <an**@andyc.comwrote in
news:BY*******************@newssvr25.news.prodig y.net:

I've noticed that if you use code for the before update
command for unbound controls, it doesn't really work.

I tried the following:

Me!ExportedYN.undo
Cancel = True
DoCmd.CancelEvent
Exit Sub

However, putting the above code in the before update on
unbound controls does NOT undo their typing. Does anyone
know the proper way for unbound controls?

Many Thanks,

The reason is that the before update event may reject an
entry because of a spelling misteak and users get annoyed if
they have to retype the whole mistake instead of just editing
the previously typed data.

In addition to the Cancel = true statement,
put me.ExportedYN.text = ""
(I'm guessing that ExportedYN is your control name. .

--
Bob Quintal

PA is y I've altered my email address.

--
Posted via a free Usenet account from http://www.teranews.com



--
Bob Quintal

PA is y I've altered my email address.

--
Posted via a free Usenet account from http://www.teranews.com

Jul 13 '07 #6
ARC wrote:
>The need to undo the checkbox is because I have the detail showing repeating
lines, so the repeating lines are bound controls. The form header controls
are all unbound, and I'm saving them via code (since I can't have 2 records
sources, I have to do unbound in for the header controls). The checkbox is a
Taxexempt switch that saves with the header area.

If you want more detail:

Header controls are for a table called Invoices which contain the main
options for the invoice, like date, invoice number, tax exempt (checkbox),
etc. I have them all unbound, and am saving the data manually via code.

Detail controls are bound and use the table InvoiceDetail.

Wish there was a way to do a different record source for the header and
details, but you can't.

Seems like you a taking the road up and down the mountain
instead of just walking around the rocks ;-)

Is there a good reason why you are not using a subform for
the invoice details? This way the main form can be bound to
the Invoice record.

--
Marsh
Jul 14 '07 #7
ARC
Yes, because I'm trying the new Access 2007 split form. This way, I can use
one form and have the header area look nice and presentable, and still
utilize a datasheet type view in the detail. So if the user maximizes the
form, and is using a big resolution, the datasheet will fill the screen,
which my user's want. I've found if you use a subform, it won't auto-expand,
unless you code it on the resize event.
"Marshall Barton" <ma*********@wowway.comwrote in message
news:cv********************************@4ax.com...
ARC wrote:
>>The need to undo the checkbox is because I have the detail showing
repeating
lines, so the repeating lines are bound controls. The form header controls
are all unbound, and I'm saving them via code (since I can't have 2
records
sources, I have to do unbound in for the header controls). The checkbox is
a
Taxexempt switch that saves with the header area.

If you want more detail:

Header controls are for a table called Invoices which contain the main
options for the invoice, like date, invoice number, tax exempt (checkbox),
etc. I have them all unbound, and am saving the data manually via code.

Detail controls are bound and use the table InvoiceDetail.

Wish there was a way to do a different record source for the header and
details, but you can't.


Seems like you a taking the road up and down the mountain
instead of just walking around the rocks ;-)

Is there a good reason why you are not using a subform for
the invoice details? This way the main form can be bound to
the Invoice record.

--
Marsh

Jul 14 '07 #8

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

Similar topics

3
by: MLH | last post by:
I have a form, bound to a query. Its RecordSource property is a query named frmEnterLienAmounts. The form has a few bound controls and some unbound controls. The unbound controls are calculated...
3
by: google | last post by:
I'm developing an application for use within my company in Access 2003. I'm new to '03, the application I did for my former employer was in '97. The two applications have similar functionality...
1
by: planetthoughtful | last post by:
Hi All, I have a mainform with a subform in which I show some task summary data. On the mainform I have a number of unbound controls that reflect values relevant to each task in the subform....
1
by: David W | last post by:
Is there a way to set a property to an expression of an unbound control without doing it in code-behind. For example, if I had a label control, and wanted to set the Text= property to a Session...
5
by: SBC News Groups | last post by:
Using VBA how do I assign columns from a table to controls on an unbound form? Mike
2
by: ccsnavy | last post by:
For some reason referencing an unbound control on an active form from a query has ceased to work correctly. While other previously existing references to unbound controls in the same form seem to...
1
by: yoni | last post by:
Hi, I got a grid control, i bind it to a datatable, but it has some extra fields, with textboxes, checkboxes, dropdowns etc (in a template field) that are not bound. they are not auto-postback...
24
by: NaftoliGug | last post by:
Is there a way to have unbound, uncalculated controls (or a calculated control that is based on a function) that retains a different value for each record?
4
by: Mike Hall | last post by:
MS Access 2007. When doing a simple record select and copy on a continous form, all the unbound controls in the form header get copied as well. Evidence of this is seen if you paste into Excel. ...
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: 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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.