473,396 Members | 1,693 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,396 software developers and data experts.

VB issue

Hello all,

Having an issue with the VB script to open a form...well not really an
issue just a feature I'm not sure if it is possible. Th script opens
a form but I would like it to open to a blank record.

Private Sub Entries_Click()
On Error GoTo Err_Entries_Click
If IsNull(Me![Last Name]) Then
MsgBox "Enter contact information before making an entry."
Else
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, ,
acMenuVer70
DoCmd.OpenForm "Entries"

End If

Exit_Entries_Click:
Exit Sub

Err_Entries_Click:
MsgBox Err.Description
Resume Exit_Entries_Click
End Sub

Any ideas?

Mar 1 '07 #1
2 1900
On Mar 1, 11:46 am, f.offenbur...@comcast.net wrote:
Hello all,

Having an issue with the VB script to open a form...well not really an
issue just a feature I'm not sure if it is possible. Th script opens
a form but I would like it to open to a blank record.

Private Sub Entries_Click()
On Error GoTo Err_Entries_Click
If IsNull(Me![Last Name]) Then
MsgBox "Enter contact information before making an entry."
Else
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, ,
acMenuVer70
DoCmd.OpenForm "Entries"

End If

Exit_Entries_Click:
Exit Sub

Err_Entries_Click:
MsgBox Err.Description
Resume Exit_Entries_Click
End Sub

Any ideas?
Sure.. First, I would recommend ditching the old DoMenuItem. Instead:

DoCmd.RunCommand acCmdSaveRecord
DoCmd.OpenForm "FormName",acNormal,,,acFormAdd

Or, use the OpenArgs to pass in a value that would then trigger the
Form_Load event to:

docmd.RunCommand acCmdRecordsGoToNew

Mar 1 '07 #2
I assume you are talking about Visual Basic for Applications (VBA), the
programming language of Microsoft Access (and other software), which is what
you show. "vbscript" is something else entirely -- executed by the Windows
Scripting Host.

Try placing your cursor after the formname "Entries", which should present
Intellisense (if you are using a recent version of Access -- it's always a
good idea to state the version you are using in your Question), and entering
commas, until you get to the DataMode argument, and the Intellisense for
that should be obvious (acFormAdd). If you are using an older version or
Intellisense just isn't working, then place your cursor in the "OpenForm"
and press F1 for Help to see what the arguments provide as options?

Larry Linson
Microsoft Access MVP

<f.***********@comcast.netwrote in message
news:11**********************@31g2000cwt.googlegro ups.com...
Hello all,

Having an issue with the VB script to open a form...well not really an
issue just a feature I'm not sure if it is possible. Th script opens
a form but I would like it to open to a blank record.

Private Sub Entries_Click()
On Error GoTo Err_Entries_Click
If IsNull(Me![Last Name]) Then
MsgBox "Enter contact information before making an entry."
Else
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, ,
acMenuVer70
DoCmd.OpenForm "Entries"

End If

Exit_Entries_Click:
Exit Sub

Err_Entries_Click:
MsgBox Err.Description
Resume Exit_Entries_Click
End Sub

Any ideas?

Mar 1 '07 #3

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

Similar topics

3
by: Paul Mateer | last post by:
Hi, I have been running some queries against a table in a my database and have noted an odd (at least it seems odd to me) performance issue. The table has approximately 5 million rows and...
7
by: George Hester | last post by:
Please take a look at this google artcle: http://groups.google.com/groups?hl=en&lr=&frame=right&th=55d6f4b50f5f9382&seekm=411f370d%241%40olaf.komtel.net#link9 The op was having trouble with...
2
by: Anthony Cuttitta Jr. | last post by:
We have an application that outputs several different graphs from data downloaded from our AS400. The application has worked without (this) issue for several months now, but just recently, the...
0
by: Kevin Spencer | last post by:
Hi all, I am working on a service that uploads METAR weather information to the National Weather Service FTP site. The service I'm authoring is hosted on a Windows 200 server, and the NWS FTP...
2
by: Ben Rush | last post by:
Hello World, Okay, I have spent the day browsing the newsgroups and reading up on article after article concerning ViewState corruption and so forth, and I have a couple questions. We...
5
by: Robert | last post by:
I have a series of web applications (configured as separate applications) on a server. There is a main application at the root and then several virtual directories that are independant...
0
by: Charles Leonard | last post by:
I am having yet another issue with Windows Server 2003. This time, the web service (a file import web service) appears to run except for one odd message: "ActiveX component can't create object". ...
4
by: Paul | last post by:
Hi, I've been struggling with this today, I'm developing a DotNet2.0 website in C# that needs to call a long running data query. Obviously this is a good candidate for an Asynchronous call, so...
1
by: AlekseyUS | last post by:
Hi, I'm a little stuck, I basically need to copy all the information within a specific file in Temp and append it to a file in another location. I'm not having any problems with smaller size...
13
by: SAL | last post by:
Hello, I'm trying to include a popup in the ItemTemplate of a gridview row. The ItemTemplate for the field contains a textbox and when the user clicks in the textbox I want a popup panel to show...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.