PC Review


Reply
Thread Tools Rate Thread

can "not in list" be used to start a macro to enter new records

 
 
Wasim274
Guest
Posts: n/a
 
      13th Jun 2009
I have a macro which allows me to enter a new record if a "not in list" error
occurs. However this often does not work usually and never at the beginning
of a session. The error message overrides and the process has to be stopped.
If I exit the form and re-enter, the table is updated and the new record gets
recorded. How can I make this work reliably?
 
Reply With Quote
 
 
 
 
Ken Snell [MVP]
Guest
Posts: n/a
 
      13th Jun 2009
You need to use VBA code for the Not In List event so that you can
"override" the built-in ACCESS message and allow the record to be added
without such message issues.

This web page shows one way to do that:
http://www.mvps.org/access/forms/frm0015.htm

--

Ken Snell
<MS ACCESS MVP>
http://www.accessmvp.com/KDSnell/


"Wasim274" <(E-Mail Removed)> wrote in message
news:E7D7C959-ADEB-43B1-AB70-(E-Mail Removed)...
>I have a macro which allows me to enter a new record if a "not in list"
>error
> occurs. However this often does not work usually and never at the
> beginning
> of a session. The error message overrides and the process has to be
> stopped.
> If I exit the form and re-enter, the table is updated and the new record
> gets
> recorded. How can I make this work reliably?



 
Reply With Quote
 
Wasim274
Guest
Posts: n/a
 
      14th Jun 2009
Thank you that is helpful. However, I was really trying to use a macro. I
thought Access 2007 allowed "OnError" (next) to be used from a Macro...or
could the code you kindly suggested be run from a macro?


"Ken Snell [MVP]" wrote:

> You need to use VBA code for the Not In List event so that you can
> "override" the built-in ACCESS message and allow the record to be added
> without such message issues.
>
> This web page shows one way to do that:
> http://www.mvps.org/access/forms/frm0015.htm
>
> --
>
> Ken Snell
> <MS ACCESS MVP>
> http://www.accessmvp.com/KDSnell/
>
>
> "Wasim274" <(E-Mail Removed)> wrote in message
> news:E7D7C959-ADEB-43B1-AB70-(E-Mail Removed)...
> >I have a macro which allows me to enter a new record if a "not in list"
> >error
> > occurs. However this often does not work usually and never at the
> > beginning
> > of a session. The error message overrides and the process has to be
> > stopped.
> > If I exit the form and re-enter, the table is updated and the new record
> > gets
> > recorded. How can I make this work reliably?

>
>
>

 
Reply With Quote
 
Steve Schapel
Guest
Posts: n/a
 
      14th Jun 2009
Wasim,

Probably for anyone to provide more explicit help, we would need to know the
details of the macro you are using, and also the nature of the error you are
getting. Can you please supply this information?

--
Steve Schapel, Microsoft Access MVP


"Wasim274" <(E-Mail Removed)> wrote in message
news:E655490C-63CA-4438-8BF7-(E-Mail Removed)...
> Thank you that is helpful. However, I was really trying to use a macro. I
> thought Access 2007 allowed "OnError" (next) to be used from a Macro...or
> could the code you kindly suggested be run from a macro?
>
>




__________ Information from ESET Smart Security, version of virus signature database 4153 (20090613) __________

The message was checked by ESET Smart Security.

http://www.eset.com



 
Reply With Quote
 
Wasim274
Guest
Posts: n/a
 
      15th Jun 2009
The following macro is called from a "not in list" event from a combo box.
Set Warnings (next)
Echo (off)
Hourglass
SendKeys + {HOME}..Yes (selects entry)
RunCommand (Copy)
OpenForm (Form Name "Frm_composer"
View "Form"
Data Mode "Edit"
Window Mode "Normal")
SetWarnings (No)
GoToRecord (Object Type "Form", Object Name "Frm_composer", Record "New"
GoToControl ("Composer")
RunCommand (Paste)
SendKeys ({ENTER},No)
GoToControl ("RegComposer")

When this macro completes, the data enry form "Frm_composer" is ready on
screen with the new name in the text box ready to be registered but the error
message "The text you entered is not in the list" overrides. The name then
has to be deleted before progress can be made. If the main data entry box is
then closed and re-opened I find the name has been added to the list and will
no longer, therefore, trigger the "not in list "error.
The curious thing is that after a few of these in any one session, the
procedure starts to work as intended and allows the new name to be entered.

"Steve Schapel" wrote:

> Wasim,
>
> Probably for anyone to provide more explicit help, we would need to know the
> details of the macro you are using, and also the nature of the error you are
> getting. Can you please supply this information?
>
> --
> Steve Schapel, Microsoft Access MVP
>
>
> "Wasim274" <(E-Mail Removed)> wrote in message
> news:E655490C-63CA-4438-8BF7-(E-Mail Removed)...
> > Thank you that is helpful. However, I was really trying to use a macro. I
> > thought Access 2007 allowed "OnError" (next) to be used from a Macro...or
> > could the code you kindly suggested be run from a macro?
> >
> >

>
>
>
> __________ Information from ESET Smart Security, version of virus signature database 4153 (20090613) __________
>
> The message was checked by ESET Smart Security.
>
> http://www.eset.com
>
>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
RE: the microsoft jet database does not recognise "[ENTER START DATE]" =?Utf-8?B?RHVhbmUgSG9va29t?= Microsoft Access Reports 0 5th Jan 2007 03:44 AM
Word Form: Move the cursor to the next tab start after "Enter." =?Utf-8?B?S2F0dXNoa2E=?= Microsoft Word Document Management 2 26th May 2006 09:39 PM
Cancel capital letter at start of new line with a manual "enter" =?Utf-8?B?Sm9vb29k?= Microsoft Word Document Management 2 6th Apr 2006 05:58 PM
"Control Enter" no longer adds "www" or ".com" to site typed into address bar in IE6 GaryB Windows XP Internet Explorer 1 28th Aug 2003 05:18 PM
"Start" "Program" "Menu" list is empty Pete Windows XP Basics 2 10th Jul 2003 11:42 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:38 AM.