I have a situation where there may be no table for a form; on error, the table is rebuilt and all is good; except to open the form, I have to click the form again. I tried
but nothing happens. I think its because the form is already open, with the Sub form_OnError. But if I try and close the form, it crashes access and I get asked to send an error report, because the code is running from the form presumably. So how do I get round it? I've tried another form, which if it isn't called from the error works fine. I've tried to run the close function from another sub, and another macro, but every time I try and close the form where the error occurs it fails
42 3358 Lysander 344
Recognized Expert Contributor
I have a situation where there may be no table for a form; on error, the table is rebuilt and all is good; except to open the form, I have to click the form again. I tried
but nothing happens. I think its because the form is already open, with the Sub form_OnError. But if I try and close the form, it crashes access and I get asked to send an error report, because the code is running from the form presumably. So how do I get round it? I've tried another form, which if it isn't called from the error works fine. I've tried to run the close function from another sub, and another macro, but every time I try and close the form where the error occurs it fails
I haven't tried this, but, if the form is already open, and having rebuilt the table within your error handling process, try me.requery or me.refresh so that the open form tries again to access your data
It opens in design mode the first time I edit the vba, but after that the result is the same. Click, and no form opens.
MMcCarthy 14,534
Recognized Expert Moderator MVP
In the Sub form_OnError code add the line. - DoCmd.Close acForm, "frmCSN"
Mary
In the Sub form_OnError code add the line. - DoCmd.Close acForm, "frmCSN"
Mary
I tried that but nothing happens (see first post) :(
MMcCarthy 14,534
Recognized Expert Moderator MVP
I tried that but nothing happens (see first post) :(
In what event have you got the code checking if the table exists?
form on error. When I try and open the form without a table associated I get an error saying to effect the table does not exist. I think I tried it under form load, but I still got the error
The code is
If dataerr = (the error code) Then
Build Table
Response = acDataErrContinue
End If
MMcCarthy 14,534
Recognized Expert Moderator MVP
form on error. When I try and open the form without a table associated I get an error saying to effect the table does not exist. I think I tried it under form load, but I still got the error
The code is
If dataerr = (the error code) Then
Build Table
Response = acDataErrContinue
End If
And where exactly did you put the form close in this code.
If dataerr = (the error code) Then
Build Table
[font=Arial]DoCmd.OpenForm "frmCSN"[/font]
Response = acDataErrContinue
End If
T'was at the end of the build table code. I also tried to launch another form and reopen frmCSN from there, without success.
MMcCarthy 14,534
Recognized Expert Moderator MVP
You need to close the form. Then build the table and then open the form again but you can't do that in the Form_Error event because once you close the form the code is no longer in focus. -
Private Sub Form_Error()
-
-
If dataerr = (the error code) Then
-
call noTable
-
End If
-
-
End Sub
-
-
Sub noTable()
-
-
DoCmd.Close acForm, "frmCSN"
-
Build Table
-
DoCmd.OpenForm "frmCSN"
-
Response = acDataErrContinue ' not sure how to cater for this as you haven't given me that part of the code
-
-
End Sub
-
Mary
I still get the error
The code I have is: -
Private Sub Form_Error(DataErr As Integer, Response As Integer)
-
If DataErr = "2580" Then
-
-
Call FormFIX
-
-
End If
-
-
End Sub
-
Sub FormFIX()
-
-
DoCmd.Close acForm, "frmCSN", acSaveNo
-
-
-
-
-
DoCmd.SetWarnings False
-
-
On Error GoTo ExitCreateCwS
-
-
Dim daodb As DAO.Database
-
Dim daotdfCwS As DAO.TableDef
-
Dim daofldCNum As DAO.Field
-
Dim daofldSNum As DAO.Field
-
Dim daofldCCanEnt As DAO.Field
-
Dim fldCNum As Field
-
Dim fmtffCNum As Property
-
Dim daoidxCNum As DAO.Index
-
Dim daofldiCNum As DAO.Field
-
Dim fldSNum As Field
-
Dim fmtffSNum As Property
-
Dim daoidxSNum As DAO.Index
-
Dim daofldiSNum As DAO.Field
-
Dim fldCCanEnt As Field
-
Dim fmtffCCanEnt As Property
-
Dim daoidxCCanEnt As DAO.Index
-
Dim daofldiCCanEnt As DAO.Field
-
Dim tdfCen As TableDef
-
Dim relCen As Relation
-
Dim tdfSub As TableDef
-
Dim relSub As Relation
-
-
Set daodb = CurrentDb()
-
Set daotdfCwS = daodb.CreateTableDef("tblCwS")
-
-
-
-
Set daofldCNum = daotdfCwS.CreateField("CNum", dbLong)
-
-
daofldCNum.DefaultValue = "10000"
-
daofldCNum.ValidationRule = "Between 10000 And 79999 And Len([CNum])=5"
-
daofldCNum.ValidationText = "Must be 5 digits long, lie between 10000 and 79999, and unique"
-
daofldCNum.Required = True
-
-
-
Set daofldSNum = daotdfCwS.CreateField("SNum", dbText, 5)
-
-
daofldSNum.DefaultValue = "11111"
-
daofldSNum.ValidationRule = "Len([SNum])=5"
-
daofldSNum.ValidationText = "Must be 5 digits long"
-
daofldSNum.Required = True
-
daofldSNum.AllowZeroLength = False
-
-
-
Set daofldCCanEnt = daotdfCwS.CreateField("CCanEnt", dbLong)
-
-
daofldCCanEnt.DefaultValue = "0"
-
daofldCCanEnt.ValidationRule = ">=0"
-
daofldCCanEnt.ValidationText = "Please enter number of candidates"
-
daofldCCanEnt.Required = True
-
-
-
-
daotdfCwS.Fields.Append daofldCNum
-
daotdfCwS.Fields.Append daofldSNum
-
daotdfCwS.Fields.Append daofldCCanEnt
-
daodb.TableDefs.Append daotdfCwS
-
-
-
-
Set fldCNum = daotdfCwS.Fields("CNum")
-
-
Set fmtffCNum = fldCNum.CreateProperty("Format", dbText, "General Number")
-
fldCNum.Properties.Append fmtffCNum
-
Set fmtffCNum = fldCNum.CreateProperty("DecimalPlaces", dbByte, 0)
-
fldCNum.Properties.Append fmtffCNum
-
Set fmtffCNum = fldCNum.CreateProperty("InputMask", dbText, "00000")
-
fldCNum.Properties.Append fmtffCNum
-
Set fmtfCNum = fldCNum.CreateProperty("Caption", dbText, "Centre number")
-
fldCNum.Properties.Append fmtfCNum
-
Set fmtfCNum = fldCNum.CreateProperty("DisplayControl", dbInteger, 111)
-
fldCNum.Properties.Append fmtfCNum
-
Set fmtfCNum = fldCNum.CreateProperty("RowSource", dbText, "SELECT tblCen.CNum FROM tblCen;")
-
fldCNum.Properties.Append fmtfCNum
-
Set fmtfCNum = fldCNum.CreateProperty("ListRows", dbInteger, 255)
-
fldCNum.Properties.Append fmtfCNum
-
Set fmtfCNum = fldCNum.CreateProperty("LimitToList", dbBoolean, True)
-
fldCNum.Properties.Append fmtfCNum
-
-
Set daoidxCNum = daotdfCwS.CreateIndex("CNum")
-
-
daoidxCNum.Required = True
-
-
Set daofldiCNum = daoidxCNum.CreateField("CNum")
-
-
daoidxCNum.Fields.Append daofldiCNum
-
daotdfCwS.Indexes.Append daoidxCNum
-
-
-
Set fldSNum = daotdfCwS.Fields("SNum")
-
-
Set fmtfSNum = fldSNum.CreateProperty("InputMask", dbText, "00000")
-
fldSNum.Properties.Append fmtfSNum
-
Set fmtfSNum = fldSNum.CreateProperty("Caption", dbText, "Subject Reference Code")
-
fldSNum.Properties.Append fmtfSNum
-
Set fmtfSNum = fldSNum.CreateProperty("UnicodeCompression", dbBoolean, True)
-
fldSNum.Properties.Append fmtfSNum
-
Set fmtfSNum = fldSNum.CreateProperty("DisplayControl", dbInteger, 111)
-
fldSNum.Properties.Append fmtfSNum
-
Set fmtfSNum = fldSNum.CreateProperty("RowSource", dbText, "SELECT tblSub.SNum FROM tblSub;")
-
fldSNum.Properties.Append fmtfSNum
-
Set fmtfSNum = fldSNum.CreateProperty("ListRows", dbInteger, 255)
-
fldSNum.Properties.Append fmtfSNum
-
Set fmtfSNum = fldSNum.CreateProperty("LimitToList", dbBoolean, True)
-
fldSNum.Properties.Append fmtfSNum
-
-
Set daoidxSNum = daotdfCwS.CreateIndex("SNum")
-
-
daoidxSNum.Required = True
-
-
Set daofldiSNum = daoidxSNum.CreateField("SNum")
-
-
daoidxSNum.Fields.Append daofldiSNum
-
daotdfCwS.Indexes.Append daoidxSNum
-
-
-
Set fldCCanEnt = daotdfCwS.Fields("CCanEnt")
-
-
Set fmtfCCanEnt = fldCCanEnt.CreateProperty("Format", dbText, "General Number")
-
fldCCanEnt.Properties.Append fmtfCCanEnt
-
Set fmtfCCanEnt = fldCCanEnt.CreateProperty("DecimalPlaces", dbByte, 0)
-
fldCCanEnt.Properties.Append fmtfCCanEnt
-
Set fmtfCCanEnt = fldCCanEnt.CreateProperty("Caption", dbText, "N° of candidates entered")
-
fldCCanEnt.Properties.Append fmtfCCanEnt
-
-
Set daoidxCCanEnt = daotdfCwS.CreateIndex("CCanEnt")
-
-
daoidxCCanEnt.Required = True
-
-
Set daofldiCCanEnt = daoidxCCanEnt.CreateField("CCanEnt")
-
-
daoidxCCanEnt.Fields.Append daofldiCCanEnt
-
daotdfCwS.Indexes.Append daoidxCCanEnt
-
-
-
-
DoCmd.RunSQL "INSERT INTO tblCwS SELECT tblCen.CNum, tblSub.SNum FROM tblCen, tblSub;"
-
-
-
Set tdfCen = daodb.TableDefs!tblCen
-
Set relCen = daodb.CreateRelation("CenCwS", tdfCen.Name, daotdfCwS.Name, dbRelationUpdateCascade + dbRelationDeleteCascade)
-
-
relCen.Fields.Append relCen.CreateField("CNum")
-
relCen.Fields!CNum.ForeignName = "CNum"
-
daodb.Relations.Append relCen
-
-
-
Set tdfSub = daodb.TableDefs!tblSub
-
Set relSub = daodb.CreateRelation("SubCwS", tdfSub.Name, daotdfCwS.Name, dbRelationUpdateCascade + dbRelationDeleteCascade)
-
-
relSub.Fields.Append relSub.CreateField("SNum")
-
relSub.Fields!SNum.ForeignName = "SNum"
-
daodb.Relations.Append relSub
-
-
-
-
ExitCreateCwS:
-
-
-
-
DoCmd.OpenForm "frmCSN"
-
Response = acDataErrContinue
-
-
-
End Sub
-
MMcCarthy 14,534
Recognized Expert Moderator MVP
Sorry take the sub FormFIX procedure out of the form code and put it in it's own module. Once the form closes the procedure is no longer available if it's in the Form code.
Mary
I already tried that.
I put it into a seperate module completely, and called that sub from the form that has to be closed. I still got the error. Is there anyway to stop a form from procesing anything?
MMcCarthy 14,534
Recognized Expert Moderator MVP
I already tried that.
I put it into a seperate module completely, and called that sub from the form that has to be closed. I still got the error. Is there anyway to stop a form from procesing anything?
Take the call out of the form_error and put it in the on error section of the Form_Load event instead.
so...
Sub Form_Load(DataErr as Integer) 'or whatever the correct call is for form load
If DataErr = 2580 Then
'Build table
DoCmd.Open "frmCSN"
End If
End Sub
?
MMcCarthy 14,534
Recognized Expert Moderator MVP
No -
Sub Form_Load()
-
On Error Go To Err_Form_Load
-
-
' your code here
-
-
Err_Form_Load:
-
Select Case Err
-
Case 0
-
Resume Next
-
Case 2580 ' catch the specific error
-
call FormFIX
-
Case Else ' All other errors will trap
-
Beep
-
MsgBox Err.Description
-
Exit Sub
-
End Select
-
Resume 0
-
-
End Sub
nico5038 3,080
Recognized Expert Specialist
Hmm, why not test the table *before* opening the form?
Use e.g.: -
dim rs as DAO.recordset
-
set rs = currentdb.openrecordset("tblCen")
-
IF rs.eof and rs.bof then
-
' rebuild the table as nothing is there
-
endif
-
-
Docmd.openform "frmCen"
-
-
Nic;o)
MMcCarthy 14,534
Recognized Expert Moderator MVP
Hmm, why not test the table *before* opening the form?
Use e.g.: -
dim rs as DAO.recordset
-
set rs = currentdb.openrecordset("tblCen")
-
IF rs.eof and rs.bof then
-
' rebuild the table as nothing is there
-
endif
-
-
Docmd.openform "frmCen"
-
-
Nic;o)
Thanks Nico
Why didn't I think of that ... Doh!
Rabbit 12,516
Recognized Expert Moderator MVP
What about an intermediary form? The original form builds the table and as the last thing it does, it opens the intermediary form. The intermediary form's On Load event closes the original form and then reopens it. The original form's On Load event closes the intermediary form.
tried it. It still crashes :(.
Is there anyway to check if a form is doing something? I can only assume that I'm trying to close it too early; it opens, causes an error, and is caught in an endless loop. But we seem to have tried everything.
Denburt 1,356
Recognized Expert Top Contributor
I think you are really REALLY close.
The Load event occurs when a form is opened and its records are displayed.
The Open event occurs when a form is opened, but before the first record is displayed.
No records error on open:
Try this: -
Private Sub Form_Open(Cancel As Integer)
-
If Err Then Cancel = True
-
End Sub
-
Rabbit 12,516
Recognized Expert Moderator MVP
Try compiling the database. Debug > Compile
Also, if you go to a line of code and press F9, it inserts a break point. When the code is running, when it gets to that line it stops and the VBA editor opens and highlights that line. F8 let's you step through the code line by line as it executes. F5 continues execution without stopping.
I often use this when I can't figure out what's wrong with my code, it allows me to pause at each step and see what's going on. A neat feature is if you hover the cursor over a variable or control name, it tells you its current value.
MMcCarthy 14,534
Recognized Expert Moderator MVP
tried it. It still crashes :(.
Is there anyway to check if a form is doing something? I can only assume that I'm trying to close it too early; it opens, causes an error, and is caught in an endless loop. But we seem to have tried everything.
Try sticking a DoEvents command at the crisis point. In other words straight before the close form command. This should process all code prior to this point before attempting to close the form
Just out of curiousity have you any code in the Form Close event?
Denburt 1,356
Recognized Expert Top Contributor
I know you are getting flooded with things to try however I just created a form the following worked and hopefully might help. -
Option Compare Database
-
Option Explicit
-
Private Sub Form_Error(DataErr As Integer, Response As Integer)
-
Call myBad
-
End Sub
-
-
Private Sub Form_Open(Cancel As Integer)
-
If Err Then Cancel = True
-
End Sub
-
-
Sub myBad()
-
MsgBox "Darn It"
-
End Sub
-
Although I was unable to get the error message not to show everything else seemed to work. I am in a pinch got to go good luck and I will check back later. I hope some of this helps. :)
Oh and I put the sub myBad in both the form and in a separate module with no problem.
just tried the form open thing on its own, with form_onerror, with and without DoEvents...nothing
It is definetly the DoCmd.Close acForm, "frmCSN" causing the error; without it there is no crash, but the one problem still remains, the form doesn't open automatically after the table has been recompiled.
Denburt 1,356
Recognized Expert Top Contributor
Utilizing the code in post 24 you will not need to close it, simply because it never opens and that is why you get an error if you are going to attempt to reopen it place you build table sub in a separate module follow Rabbits instructions (Post 22) and add the DoEvents as Mary suggested and it should work.
MMcCarthy 14,534
Recognized Expert Moderator MVP
just tried the form open thing on its own, with form_onerror, with and without DoEvents...nothing
It is definetly the DoCmd.Close acForm, "frmCSN" causing the error; without it there is no crash, but the one problem still remains, the form doesn't open automatically after the table has been recompiled.
Did you try Nico's suggestion of checking to see if the table exists without opening the form at all?
Denburt 1,356
Recognized Expert Top Contributor
1 more before I go I just noticed nico's suggestion and it is a good one uh post 17 also when you click the button, or whatever event you use to open this form run his routine before even trying to open the form. If needed build it then open. Sounds like a good plan there.
LOL Mary got in when I wasn't looking :)
ADezii 8,834
Recognized Expert Expert
I have a situation where there may be no table for a form; on error, the table is rebuilt and all is good; except to open the form, I have to click the form again. I tried
but nothing happens. I think its because the form is already open, with the Sub form_OnError. But if I try and close the form, it crashes access and I get asked to send an error report, because the code is running from the form presumably. So how do I get round it? I've tried another form, which if it isn't called from the error works fine. I've tried to run the close function from another sub, and another macro, but every time I try and close the form where the error occurs it fails
I don't mean to over simplify matters, and I have only had a short glimpse at the code, but to me the answer seems fairly obvious. You cannot trap this Critical Error in the Form's Error() Event. The condition of the non-existant Table which is the Record Source for the Form should be checked as soon as the Database opens. I've scaled down your code and I have arrived at a solution, hopefully it is one which you can implement: - Create an AutoExec Macro and have it call a Public Function, in this case it would be fCheckForfrmCSN().
- This Function will loop through the TableDefs Collection, and if it finds tblCwS, it sets a Boolean Variable (blnTableFound = True). This Variable is initially initialized to False though it need not be.
- The value of blnTableFound is next examined: if it is True, meaning tblCwS does exist, frmCSN is simply opened.
- If blnTableFound = False, meaning tblCwS does not exist, the Public Sub-Routine Rebuild_Test_Table is called, then frmCSN is opened.
- Again, if I have oversimplified the problem or did not read enough into it I apologize, but the code below has been tested and is fully functional. Remember, I tested it on a scaled version of what you have displayed.
- Please let me know what you think - I'm very interested in seeing if this solution is acceptable.
Call from the AutoExec Macro, or from an Initial Display Form if more practical: - Public Function fCheckForFormCSN()
-
Dim MyDB As DAO.Database, Mytdf As DAO.TableDef
-
Dim blnTableFound As Boolean
-
-
blnTableFound = False
-
-
Set MyDB = CurrentDb()
-
-
For Each Mytdf In MyDB.TableDefs
-
If Mytdf.Name = "tblCwS" Then
-
blnTableFound = True
-
Exit For
-
Else
-
End If
-
Next
-
-
If blnTableFound Then
-
DoCmd.OpenForm "frmCSN", acNormal, , , acFormEdit, acWindowNormal
-
Else
-
Call Rebuild_Test_Table
-
DoCmd.OpenForm "frmCSN", acNormal, , , acFormEdit, acWindowNormal
-
End If
- End Function
-
Missed post 16, 17 last night. loads of responses and stuff to try out!
Going to try out Nico's idea, then play around with azii's and mary's idea
I'll be back in a few minutes!
- Sub Form_Load()
-
On Error GoTo Notable
-
-
Notable:
-
Select Case Err
-
Case 0
-
Resume Next
-
Case 2580 ' catch the specific error
-
Call FormFIX
-
Case Else ' All other errors will trap
-
Beep
-
MsgBox Err.Description
-
Exit Sub
-
End Select
-
Resume 0
-
End Sub
Error still comes up, and the table is not built. FormFIX is a Sub (by default, Public) in another module called nonformsubs
Form open, form load etc do not work. The error of there being no record source for the form comes up first.
With the 'checking on database load'; is there anyway to loop it, so it always checks for the presence of the tables; if they don't exist, build them? Or to make a preliminary check before forms are opened?
NeoPa 32,557
Recognized Expert Moderator MVP
I have a situation where there may be no table for a form; on error, the table is rebuilt and all is good; except to open the form, I have to click the form again. I tried
but nothing happens. I think its because the form is already open, with the Sub form_OnError. But if I try and close the form, it crashes access and I get asked to send an error report, because the code is running from the form presumably. So how do I get round it? I've tried another form, which if it isn't called from the error works fine. I've tried to run the close function from another sub, and another macro, but every time I try and close the form where the error occurs it fails
I'm afraid I haven't had a chance to go through the whole thread yet, but I had an idea which may help you. Apologies if this has been propounded already.
First, before I go on, have you tried creating the table then trying a .Requery? I'll assume you have considered that already.
Otherwise, think about creating another form, whose job it is simply to check for the existence of the table (and create it if/where necessary) then opens up your form and closes itself. You may even get away with having an invisible form to do the job if you prefer. I'm not sure that would work but you could try it if that appeals.
Tried it!
Basically, I can't open a form using DoCmd.OpenForm, because no form opens, and if I close the form then open it, using DoCmd.Close, access crashes, even if it is in a seperate sub, form, or module.
So, I think I'll just put an MsgBox at the end of the script and ask the user to reopen the form because an error has occured and has now been fixed.
That works at least! It doesn't solve the problem, but it'll do for an alternate solution at least. Unless anyone has any better ideas?
NeoPa 32,557
Recognized Expert Moderator MVP
Tried it!
Basically, I can't open a form using DoCmd.OpenForm, because no form opens, and if I close the form then open it, using DoCmd.Close, access crashes, even if it is in a seperate sub, form, or module.
So, I think I'll just put an MsgBox at the end of the script and ask the user to reopen the form because an error has occured and has now been fixed.
That works at least! It doesn't solve the problem, but it'll do for an alternate solution at least. Unless anyone has any better ideas?
You leave us all guessing what exactly it was that you tried.
I find it hard to believe you've tried my suggestion and got those results, but if you can be a little clearer in what you're saying, I'm sure we can all understand.
Rabbit 12,516
Recognized Expert Moderator MVP
Did you try compiling and setting a break to step through the code line by line yet?
I did the compiling thing, that's how I found out what was causing the crash.
On the form_error event, I included the code to build the table, and then put 'Me.Requery', 'Me.Repaint', and 'Me.Refresh', all to no effect; the table could not refresh when the form was opening.
NeoPa 32,557
Recognized Expert Moderator MVP
Thank you. That's much clearer :)
Perhaps you'd like to give post #33 a try?
I have tried: 1. Building the table, and reopening the form after this has been done.
This built the table, but did not reopen the form. 2. Building the table, closing the form, and reopening it after.
This caused Access to crash, but if the form was closed after the table was built, the table existed. 3. Building the table, refreshing the form.
Table is built, but no form appears. 4. Building the table, and using 'DoEvents' before closing the form, and reopening it.
Access crashed, but built the table.
All of these were tried in various order, under various different form events.
Over the course of it I have learnt: 1. It is definetly the DoCmd.Close acForm, "frmCSN" that causes access to break. 2. Any action must start in the Form_OnError event.
Hope that helps clarify things. I'm sure inevitably there are things I have missed. I haven't as yet done the database (on load) idea.
Thank you. That's much clearer :)
Perhaps you'd like to give post #33 a try?
will do.
does anyone know if there is a timer function in vba?
MMcCarthy 14,534
Recognized Expert Moderator MVP
I have tried: 1. Building the table, and reopening the form after this has been done.
This built the table, but did not reopen the form. 2. Building the table, closing the form, and reopening it after.
This caused Access to crash, but if the form was closed after the table was built, the table existed. 3. Building the table, refreshing the form.
Table is built, but no form appears. 4. Building the table, and using 'DoEvents' before closing the form, and reopening it.
Access crashed, but built the table.
All of these were tried in various order, under various different form events.
Over the course of it I have learnt: 1. It is definetly the DoCmd.Close acForm, "frmCSN" that causes access to break. 2. Any action must start in the Form_OnError event.
Hope that helps clarify things. I'm sure inevitably there are things I have missed. I haven't as yet done the database (on load) idea.
Have you tried Nicos suggestion of checking for the tables existance without opening the form at all and only opening the form after the table is found or built?
I figured it out!
DoEvents wasn't working, but it had something to do with time; I had to wait for the error code to finish.
So... -
Sub Form_Error(DataErr As Integer, Response As Integer)
-
If DataErr = "2580" Then
-
-
Response = acDataErrContinue
-
DoCmd.OpenForm "FormFix"
-
-
End If
-
-
End Sub
-
-
Sub Form_Load()
-
Me.Visible = False
-
Me.TimerInterval = 2
-
-
End Sub
-
Sub Form_Timer()
-
DoCmd.SetWarnings False
-
-
On Error GoTo ExitCreateCwS
-
-
'Build table
-
-
ExitCreateCwS:
-
-
DoCmd.OpenForm "frmCSN"
-
DoCmd.Close acForm, Me.Name, acSaveNo
-
-
End Sub
-
NeoPa 32,557
Recognized Expert Moderator MVP
Good for you.
It's great when it all comes together :)
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: MLH |
last post by:
If you have these lines in code on MyForm1...
DoCmd OpenForm "MyForm2`"
MsgBox "I opened MyForm2"
Is it #ALWAYS# true that all form events
on MyForm2 will occur before the MsgBox
statement...
|
by: Lyn |
last post by:
Hi, this has been driving me nuts. I'm on Office 2003 SP1, Win XP SP1.
I am opening a form with a number of subforms based on various tables. The
subforms are populated via the main form's...
|
by: Jim Evans |
last post by:
Using code and suggestions from an earkier thread in this group, I have
created the following cond for the open event of a form I am opening from
the button click event of another form.
...
|
by: Rolan |
last post by:
I need assistance regarding code needed to prevent someone from opening
a form if a table field name(s) has been changed. For example, there is
existing code to check for certain data based on...
|
by: Norm |
last post by:
I must not be understanding something about the use of forms in VB.Net that
is different from VB. I have one form running in the background with an icon
in the task bar. Right clicking on the icon...
| |
by: MartinR |
last post by:
Hi,
I'm still new to writing code in vba as I've only been introduced to
access three weeks ago. I have written this code below and it executes
but does not do what I want it to do. What I want is...
|
by: frenchy |
last post by:
I am getting this error in Adobe after struggling with a 'submit'
button on an acrobat form that is in production and all the other
appdev people in the office are NOT having a problem with. It...
|
by: Coll |
last post by:
I have a form with a subform on it. On my main form, you select an
employee id number and the top portion of form fills in with data, and
the bottom portion of the form,which is a subform, lists...
|
by: martin DH |
last post by:
**Urgent Need**
I'll throw out the basics and any assistance is very, very, very much appreciated!
Access 2003 on XP
On a form (frmMain) is an option group of check boxes (ReportFrame) from...
|
by: angi35 |
last post by:
Hi - In Access 2000, I'm trying to create a switchboard so users can open a certain form with different filters. I thought I would use an option group with toggle buttons. I suppose it could be...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
| |
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...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
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...
|
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: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |