Set form dirty through unbound control

Dear all,

I have an unbound listbox (multiselect) on a bound form.
The listbox and its selection are populated via vba from a table.

I have an invisible helper txt field which is bound to a table.

The helper txt receives whatever is selected in the listbox by setting
its value property to the list box elements.

Unfortunately this does not make the form dirty. Apparently changing
the value property of a txt field does not trigger the dirty event but
only changing the text property of a text field does.

I can not set the text value of my little helper txt field because it
has to have focus and for getting focus it has to be visible.

Is there a way to make the form dirty via VBA from the listbox? Can I
somehow trigger the event?

I tried to set the text property of a visible bound text field
( Me.txtAlias.Text  = Me.txtAlias.Text ) but I am getting a run time
error 2115 - macro or function set to beforeupdate or validation rule
is preventing the application from saving data into the field. Even
though I positively to not have beforeUpdate of Validation rules on
txtAlias...

Any help is appreciated

Cheers

Torsten

1
twinkler
6/26/2007 4:53:50 PM
access.formscoding 7493 articles. 0 followers. Follow

2 Replies
2924 Views

Similar Articles

[PageSpeed] 10

twinkler wrote:
>I have an unbound listbox (multiselect) on a bound form.
>The listbox and its selection are populated via vba from a table.
>
>I have an invisible helper txt field which is bound to a table.
>
>The helper txt receives whatever is selected in the listbox by setting
>its value property to the list box elements.
>
>Unfortunately this does not make the form dirty. Apparently changing
>the value property of a txt field does not trigger the dirty event but
>only changing the text property of a text field does.
>
>I can not set the text value of my little helper txt field because it
>has to have focus and for getting focus it has to be visible.
>
>Is there a way to make the form dirty via VBA from the listbox? Can I
>somehow trigger the event?
>
>I tried to set the text property of a visible bound text field
>( Me.txtAlias.Text  = Me.txtAlias.Text ) but I am getting a run time
>error 2115 - macro or function set to beforeupdate or validation rule
>is preventing the application from saving data into the field. Even
>though I positively to not have beforeUpdate of Validation rules on
>txtAlias...


Events are not triggered by code stting a control's value.
(The Dirty property will be set though.)

However, that's not a serious issue because you can call any
procedure in your code.  To call the Dirty event procedure,
use:
	Form_Dirty dummy

-- 
Marsh
MVP [MS Access]
0
Marshall
6/26/2007 5:22:48 PM
On Jun 26, 7:22 pm, Marshall Barton <marshbar...@wowway.com> wrote:
> twinkler wrote:
> >I have an unbound listbox (multiselect) on a bound form.
> >The listbox and its selection are populated via vba from a table.
>
> >I have an invisible helper txt field which is bound to a table.
>
> >The helper txt receives whatever is selected in the listbox by setting
> >its value property to the list box elements.
>
> >Unfortunately this does not make the form dirty. Apparently changing
> >the value property of a txt field does not trigger the dirty event but
> >only changing the text property of a text field does.
>
> >I can not set the text value of my little helper txt field because it
> >has to have focus and for getting focus it has to be visible.
>
> >Is there a way to make the form dirty via VBA from the listbox? Can I
> >somehow trigger the event?
>
> >I tried to set the text property of a visible bound text field
> >( Me.txtAlias.Text  = Me.txtAlias.Text ) but I am getting a run time
> >error 2115 - macro or function set to beforeupdate or validation rule
> >is preventing the application from saving data into the field. Even
> >though I positively to not have beforeUpdate of Validation rules on
> >txtAlias...
>
> Events are not triggered by code stting a control's value.
> (The Dirty property will be set though.)
>
> However, that's not a serious issue because you can call any
> procedure in your code.  To call the Dirty event procedure,
> use:
>         Form_Dirty dummy
>
> --
> Marsh
> MVP [MS Access]

Thanks heaps Marsh, your suggestion works!

Cheers

Torsten

0
twinkler
6/27/2007 11:58:23 AM
Reply:

Similar Artilces:

Undo dirty form after opening popup form
I have a subform within a main form. On the subform is an option group with three option buttons. When you click on any of the option buttons a popup form opens to which the user inputs a date. I need the user to be able to click a cancel button on the popup form that would close that form without saving changes and undo changes on the underlying subform (i.e. return the option button to it's original selection) that initiated the popup. Can someone help me with the right syntax to use in the code? Thanks much! I tried this behind the click event of the "Cancel" button on t...

Excel data entry: choice of control for selection
I need to distribute a workbook as a data entry device that applies a few constriants. In column A I have a list of Names. In Column B a City needs to be selected from a limited list for each Name. The text below describes "nearly there" options I've explored; but I'd like opinion from experience. The objective is to be easy to for the user to work around, reliable for its purpose of constraining values, and ease of build and maintenance. 1. Is there a good way to replicate a Forms control (e.g., the listbox) down an Excel column, so that it both addresses the cell benea...

Exchange Server 2007 and Domain Controllers
Hello, Could someone please tell me if I have to install Exchange Server 2007 on a AD Domain Controller, or can it be installed on a member server? I have a Windows 2008 Server that is a member server in a Windows 2003 Active Directory network that I'm looking to install Exchange 2007 on. Also, could someone tell me if there are any articles out there that will help me install my Exchange 2007 in the same domain as an existing Exchange 2003 Server (running on Windows 2000 Server)? I'm looking to install the new Exchange 2007 as a new server (new name) and migrate th...

Using Access form to assign values of variables in an Excel VBA program
I have created a VBA program for Ms Excel.But,to get desired results, every time, I go into the code to change the values of variables.Is there a way to get the values of variables stored in an Access table? YOu need to do a search for ADO method (ActiveX Data Object). There are plenty of example of code on the web. You need to add two references in your VBA to use the method. from VBA menu tools - References 1) Microsoft Access XX.X object library 2) Microsfot ActiveX Data Objects X.X library Use the latest versio of the two libraries on your PC. You will make a conn...

How do I get other email form my other accounts to show up
I have an email with hotmail, I would like to show up on my outlook and I have an email with my university, I would like to show up on my outlook. Is this possible and how if it is? How to Configure Outlook with Hotmail http://support.microsoft.com/default.aspx?scid=kb;en-us;287424 How do I add a POP3 email account in MS Outlook 2003? http://support.ephost.com/Customer/KBArticle.aspx?articleid=3 "MIKE25" <MIKE25@discussions.microsoft.com> wrote in message news:CC42F32B-FCB4-42C3-AA1D-E29D3E314DCA@microsoft.com... >I have an email with hotmail, I would like to show up ...

Form Error (Query Update)
Hi, I have about 12 people to work on the database and each has own userID and password. Their UserID and Password input and the form link to the query that has the filter on "UserID and Password" for their input. The message said "Can't Update; Query Locked". Is there I do something wrong? I thought the form is the shared for everyone to input based by UserID and Password. Please help. Thanks We aren't there. We can't see how your database is set up. For instance, do you have a split database, with a single "back-end" file on your network an...

How to set appointment at 4:15pm instead of 4pm or 4:30pm
I can't figure out how to get Outlook to allow me to start an appointment at 4:15pm. Outlook only allows me to set the appointment at 4pm or 4:30pm. I'm using Office 2003 for Students & Teachers and WinXP professional. Any suggestions would be much appreciated. Highlight the :30 with your mouse and type over :15. -- Patricia Cardoza Outlook MVP Author - Special Edition Using Microsoft Office Outlook 2003 Lead Author - Access 2003 VBA Programmer's Reference Author - Absolute Beginner's Guide to Microsoft OneNote 2003 http://blogs.officezealot.com/cardoza http://www...

Disable/Enable all controls on a form based on value of another control
What is the best to way to exclude a specific control (or controls) from the following condition? (e.g., I would like to exclude SubjectID and MRN from being Enabled or Disabled): ### Dim Ctl As Control On Error Resume Next If IsNull(Me.SubjectID) OR IsNull(Me.MRN) Then For Each Ctl In Me.Controls Ctl.Enabled = False Next Ctl Else For Each Ctl In Me.Controls Ctl.Enabled = True Next Ctl End If ### I'm using this to ensure that the user enters the SubjectID and MRN *before* entering more data for the subject. By disabling all the...

Form Speed
Hi All, Has anyone noticed speed improvements by writing less code in the actual form module and keeping most of the code in a seperate module? Matt wrote: > Hi All, > > Has anyone noticed speed improvements by writing less code in the > actual form module and keeping most of the code in a seperate module? No, the reverse is probably true, but only by microseconds. Forms are slowed by the abundance of data. Limit the data by using queries on properly indexed tables, and you speed up forms immensly. -- Arvin Meyer, MCP, MVP http://www.datastrat.com http://www.mvps.org/access ...

Controlling Spell Checker
Is there way to have control over the MS-Access spell checking (besides just launching it)? We want to tell it to check all records, but skip certain fields (or, alternatively, ONLY check certain fields). Is that possible? Alternatively, if that's not, we noticed that the spell checker skips fields that are disabled. So one could disable the fields to be skipped; run the spell checker; and then re-enable those fields when done. But how would one know when it's done. Any ideas/suggestions/hints/etc.? Thanks, Neil Hi Neil, > Is there way to have control over the MS-Acces...

Setting up a new integration for Wennsoft subcontractors
Hello, I'm having difficulty in setting up a new integration for importing vendors and subcontractors from one data base to the another. I need to be able to stipulate Jobs and cost codes against these as well though I think I'll need to create new integrations for that? Any ideas?? Cheers ...

How can we make a control in a form to a required field
Hello, My form is based on a query which consists of 3 tables: 1. Inovices 2.Supplier 3.Projects There is a tendency save the record without filling in the supplier number and when they want to update the record they can not see anymore the record. Wht is the VBA in the controls/field of the form that supplier number and project number are compulsory meaning they can not save the record if they leave thses 2 fields missing Thanks in advance -- H. Frank Situmorang Frank, Don't go about this in VBA. Put the restrictions in the table design by setting the field properties to requi...

Allen Browne's Calendar Control
I am attempting to use Allen Browne's calendar control located at: http://allenbrowne.com/ser-51.html But I am getting the following error when I click on the calendar button: "Compile error: Can't find project or library" The Yellow debug arrow points to the following lines of code: Private Sub Form_Open(Cancel As Integer) On Error GoTo Form_Open_Err 'Initialize to the existing date, or today if null. If IsDate(gtxtCalTarget) Then Me.txtDate = gtxtCalTarget.Value Else Me.txtDate = Date End If With "Date" after the equals ...

When Load Form
I would like for my textbox to update when my form loads. I tried the following code, but my textbox just stays blank. Private Sub Form_Load() Text0.Text = "hello" End Sub Any ideas? On Jul 4, 10:51 pm, "Tim McGavin" <n...@gsw-inc.com> wrote: > I would like for my textbox to update when my form loads. > > I tried the following code, but my textbox just stays blank. > > Private Sub Form_Load() > Text0.Text = "hello" > End Sub > > Any ideas? Try this Text0.Value = "hello" On Wed, 4 Jul 2007 23:51:25 -0500, "...

Aligning controls at runtime
Hi , I have a form designer. The user can drag drop controls on the form. I need to work on a feature where a user can align the controls placed on the form. All of this is at runtime. Can someone help me in this regard? Thanx in advance. Sandy. Sandy wrote: > Hi , > > I have a form designer. The user can drag drop controls on the form. I > need to work on a feature where a user can align the controls placed on > the form. All of this is at runtime. Can someone help me in this > regard? > > Thanx in advance. > Sandy. > Every control is a CWnd. Its current...

Contact Form
Hello, I'm using Outlook 2003. How can i create a new form and use it? Thanks See http://www.outlookcode.com/d/forms.htm=20 --=20 Sue Mosher, Outlook MVP Author of Microsoft Outlook Programming - Jumpstart for=20 Administrators, Power Users, and Developers http://www.outlookcode.com/jumpstart.aspx "B_" <me@theworld.com> wrote in message = news:42cedb50$0$96970$e4fe514c@news.xs4all.nl... > Hello, >=20 > I'm using Outlook 2003. >=20 > How can i create a new form and use it? >=20 > Thanks >=20 > Tools->Forms->Design...

Display Date from Unbound Field in Form in a Query
Just had an issue that in 10 years of using Access never saw - just wondering if I just never encountered it or what... I have a form running a query, the user enters a date. The report needs to show the date - so the query has a field like this: report date: [Forms!]![frm_report]![txtReportDate] I had a problem exporting to Excel - seems the direct placement in the query led to characters that Excel could not understand. I actually had another date field from the form that I did a date add on, it worked fine. I eventaully put the form reference in a Format, the issue was gone. The...

Unable to set Date Range on UPR_Month_End
I am in Dexterity, and I am opening the form UPR_Month_End and setting the date range unfortunatly the set start date and end date are being wiped out before the form makes it to the user. My code worked before the last service pack from Great Plains, and I have tried many things to get it to work. Basically what i am doing is on a button click on one of my forms I am trying to set the date range on the period end payroll reports screen to the beginning and end of a quarter for convienence because the ability to run quarter end reports was removed from Great Plains. Below is the code...

How to set Cache Mode via Group Policy?
Hey everyone, We are running Win2k3 and Exchange 2003 in a 2003 domain. I need to push out "Cached Exchange Mode" to everyone. Anyone know how I can do this? I was thinking Group Poilcy via the Office 2003 ADM but I don't see options for Outlook. -- TIA, Clayton P.S.: I wrote an iTunes podcast tutorial and just want to publicize it. You can find it at: http://www.nikoli.net/itunepod ******************* On Fri, 06 Apr 2007 18:21:20 GMT, "Clayton Sutton" <none@none.com> wrote: >Hey everyone, > >We are running Win2k3 and Exchange 2003...

Line Item Comment Text On Forms
Good morning. I am trying to get the line item comment text to appear on my Sales Transaction entry forms (i.e. quotes, orders, and invoices). At present, this field shows but only 4 lines of text and only so wide. I would like to get infinite lines of text with the field growing or shrinking as need be on the form. Would appreciate any advice here. cheap ugg > On Tuesday, July 26, 2011 10:50 AM Mark Plaideau wrote: > Good morning. > > > > I am trying to get the line item comment text to appear on my Sales Transaction entry forms (i.e. quotes, orders, and invoi...

Add new fields to a form
Access Newbie here. I created a simple little Contacts database and emailed it to my data entry person who is in another city. She has already entered quite a few records. Now I would like to add a couple of new fields to the form. Whats the best way to do that? Is it possible for me to email her the new form and she can import it into her database? James The database should be split into a front-end (containing the queries, forms, reports, macros and modules), linked to a back-end (containing the tables and relationships). In that way, anytime you need to make an application ch...

looping through controls
If the user checks selects 'Yes' from a combo box, I'd like to enable a group of check boxes (all have tag property "col"). If the user selects 'No', I'd like to disable them but, if any are checked, tell the user data will be deleted and then set the checkboxes = Null (assuming the user says okay). My current code triggers the prompt for *each* check box that's checked, rather then looping through them automatically. Do I need to another "For each ..." clause after the first Else statement? ### Private Sub cboColor_AfterUpdate() ...

set first day of the week
hi, how to change the first day of the week (that my boss use a weekly reports) set datefirst 6 statment, completed succesfully but with no changing of default setting ( 7 ) ,any help please thanks ...

delegate Control #3
I would like to rollout delegate control over our domain could any poin tme to a good website that explains what each custom control does? Many Thanks Will ...

Run-time error 2137 Received On Form Open
Hi All, I have a switchboard that enables users to add, edit, or view reports. My edit button runs a marco that opens my form but then also runs code Find(). This has worked for a few years but now a user receives the run-time error 2137 when they click that button. Any ideas on the fix or should the user upload another copy of their front end? It is running on Access 2003. Thanks. Is it one user or are there multiple users which get the error. Has a service pack been installed? Take a look here: http://www.allenbrowne.com/bug-Access2003SP3.html First start by co...