Database Management
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesDatabase Management

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here!
  #1  
Old March 21st, 2003, 08:35 AM
annt annt is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Posts: 1 annt User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question Access 2000 and VBScript Help Please

I have created a simple Access Database and am working on 2 different data access pages. I have 2 problems on the VBScript.

1. I am trying to program a FIND button. The idea is simply that the user enters a text string into a textbox named txtSearch and upon clicking the command button named Command0, the record containing the string is found. I found a how-to on this on Microsoft's website. But when I use the script in Northwind, it works. When I use it in my database (after changing references), I get a "Microsoft Cursor Engine" error while debugging. Here is the script:

<SCRIPT language=vbscript event=onclick for=Command0>
<!--
dim i

dim fld
dim FieldCount

FieldCount =MSODSC.DefaultRecordset.RecordCount

for i = 0 to FieldCount - 1
set fld = MSODSC.Recordset.fields(i)
MSODSC.DefaultRecordset.Find fld.name & " = '" txtSearch.value & "'", 0, 1, 1

if MSODSC.DefaultRecordset.EOF then
MSODSC.DefaultRecordset.MoveFirst
else
exit for
end if
next

set fld = nothing
-->
</SCRIPT>

What is wrong?

2. In another data access page, I'd like it to open to a new record. I added an "Add Record" button, that Access automatically programmed for me. It used JScript's try...catch statement. I took that script, changed references, and tried to use it under MSODSC's Current Event. It works only after giving me a blank Warning message that I click ok through. Why does it give me the error for the current event, but not for the OnClick event of the command button? Here's the code:

<SCRIPT LANGUAGE=javascript FOR=MSODSC EVENT=Current>
<!--
try { MSODSC.CurrentSection.DataPage.NewRecord(); }
catch (e)
{ alert (e.description);
-->
</SCRIPT>

I would appreciate any help!!! I have been researching these problems and have not been able to find the answers. I am stuck.

THANK YOU!!!!

Last edited by annt : March 21st, 2003 at 08:47 AM.

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesDatabase Management > Access 2000 and VBScript Help Please


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway