I have a form 'FmMessages" and a form 'FmLeads'.
'FmMessages', through code, opens 'FmMessages" if it is not already
open.
It then sets focus on 'FmLeads' and runs the following code:
Dim rst As Object
Dim Tid As Long
If typetransfer = "Valid Number" Or typetransfer = "New Number" Then
DoCmd.GoToRecord , , acNewRec
Me.ID = Forms![FmMessages].testCode
Set rst = Me.Recordset.Clone
Tid = Me.ID
If Not IsNull(DLookup("ID", "Contacts", "ID = " & Tid)) Then
MsgBox "ID Number Already Exists", vbExclamation, "Taking you
to that record"
Me.Undo
rst.FindFirst "ID = " & Tid
Me.Bookmark = rst.Bookmark
End If
....more code here
End if
All of this runs just fine if 'FmLeads' was closed and then opened by
code in 'FmMessages'.
My problem comes when the 'FmLeads' form is already open. The line:
DoCmd.GoToRecord , , acNewRec
now produces the following error:
Run-time error '2499'
"You can't use GoToRecord a"ction or method on an object in Design
view"
Needles to say, form 'FmLeads' is not open in design view, and it does
have focus.
Your help would be very much appreciated 1 4397
On Aug 13, 3:48*pm, dee <promotions.market...@comcast.netwrote:
I have a form 'FmMessages" and a form 'FmLeads'.
'FmMessages', through code, opens 'FmMessages" if it is not already
open.
It then sets focus on 'FmLeads' and runs the following code:
Dim rst As Object
Dim Tid As Long
If typetransfer = "Valid Number" Or typetransfer = "New Number" Then
* * DoCmd.GoToRecord , , acNewRec
* * Me.ID = Forms![FmMessages].testCode
* * Set rst = Me.Recordset.Clone
* * Tid = Me.ID
* * If Not IsNull(DLookup("ID", "Contacts", "ID = " & Tid)) Then
* * * * MsgBox "ID Number Already Exists", vbExclamation, "Takingyou
to that record"
* * * * Me.Undo
* * * * rst.FindFirst "ID = " & Tid
* * * * Me.Bookmark = rst.Bookmark
* * End If
* * ....more code here
End if
All of this runs just fine if 'FmLeads' was closed and then opened by
code in 'FmMessages'.
My problem comes when the 'FmLeads' form is already open. The line:
* * DoCmd.GoToRecord , , acNewRec
now produces the following error:
Run-time error '2499'
"You can't use GoToRecord a"ction or method on an object in Design
view"
Needles to say, form 'FmLeads' is not open in design view, and it does
have focus.
Your help would be very much appreciated
Where does the code with the GoToRecord in it run? In the Load event
of fmLeads? Also what is TypeTransfer? Is that a field on fmLeads or
a function? Finally, what code are you using to actually open
fmLeads?
Bruce This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: leroybt.rm |
last post by:
Can someone tell me how to run a script from a interactive shell
I type the following:
>>>python filename
>>>python filename.py
>>>run filename
>>>run filename.py
>>>/run filename
>>>/run...
|
by: Ed |
last post by:
Hello,
I took a course in asp about 2 years ago and I was
practicing with IIS 5.0. Then I put it down for a while.
Now trying to get back to it. I can't run asp files from
subdirectories of...
|
by: orekin |
last post by:
Hi There
I have been trying to come to grips with Application.Run(),
Application.Exit() and the Message Pump and I would really appreciate
some feedback on the following questions .. There are...
|
by: Bob Day |
last post by:
Using vs2003, vb.net
I start a thread, giving it a name before start. Code snippet:
'give each thread a unique name (for later identification)
Trunk_Thread.Name = "Trunk_0_Thread"
' allow...
|
by: Bryan |
last post by:
How can i run a bit of code straight from the IDE? Right now i make a
temporary button and put the code behind that, then i run debug mode
and click on the button. Is there a way to highlight...
|
by: Brett Wesoloski |
last post by:
I am new to VS2005.
I changed my program.cs file to be a different form I am working on. But
when I go to run the application it still brings up the form that was
originally declared as new. ...
|
by: Lee Crabtree |
last post by:
I remember when I was first getting into .NET Forms programming that
there was a rather emphatic rule about not constructing a form before
calling Application.Run with it. So this:
...
|
by: David Thielen |
last post by:
Hi;
In our setup program how do I determine if I need to run "aspnet_regiis –i"
and if so, is there an API I can calll rather than finding that program on
the user's disk and calling it?
--...
|
by: traceable1 |
last post by:
Is there a way I can set up a SQL script to run when the instance
starts up?
SQL Server 2005 SP2
thanks!
|
by: mxdevit |
last post by:
Task: run application from ASP.NET
for example,
you have a button on ASP.NET page, when press this button - one
application is invoked.
the code to run application (for example, notepad) is...
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
| |