Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




Open Form Modal In Access


How I can to open a fomr modal in access???

thanks for advance...




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Open Non Modal Form From A Modal
Hi,
I need to open a non modal form from a modal one.
If i use the function "Show", it gives an error that it cannt be done.
Do u know a way to do it?

Thanks in advance

[Help] Why I Can't Open A Form With Modal Mode
Dear All,

I am using eMbedded Visual Basic 3.0.
I have some questions about:

1. let say, I have 2 forms, Form1 & Form2. In Form1 open Form2 with style = 0. (Form1 also open with style = 0) Form1 should be waited until Form2 release.
    
(Form1)
    .
    .
        Form2.Show 0
    Me.Hide
    .
    .

  but Form1 was performed as a modaless form and not waiting Form2. What am i wrong?

2. How to return a value from Form2?
    I use a method

(Form2)    .
    .
    Form1.text1.text = Form2.text1.text
    Form1.Show 0
    Me.Hide
    .
    .

  Is this a stupid method? Any better way?

Thanks
        

Open Windows ODBC Manager Form In Modal Mode
I have a program which need to call the windows ODBC Manager program . How can i open it in modal mode, since the form that call the ODBC already in model mode

Thanks

Modal Form In Access
I have a form I want to have focus until it is done, and then return a value. An Input or MsgBox won't do what I want. This is easy in VB6. I want some kind of neat encapsulation.

Does anyone have any ideas?

What Does This Error Mena - Cant Show Non-modal Form When Modal Form Is Being Display
cant show non modal form when modal form is being displayed - whats does that error mean? and how can i fiz it?

Run-time Error '401': Can't Show Non-modal Form When Modal Form Is Displayed
What does this error message means?

Code:Run-time error '401': Can't show non-modal form when modal form is displayed

?

Runtime Error 401 Can't Show Non-modal Form When Modal Form Is Displayed
Hey guys !

I am going crazy due to this (Runtime Error 401 Can't show non-modal form when modal form is displayed)

This error doesn't occur while I test the software in the VB run mode... only when i run the exe !

Any ideas why this is happening ?

chao





Edited by - pingu2k on 2/20/2007 6:00:02 AM

Can't Show Non-modal Form When Modal Form Is Displayed??? Only When Burned On Cd
Hello guys, i have this problem:
When i burn my program on cd and try to run it i get this error: Can't show non-modal form when modal form is displayed
then if i click OK another error: unable to find d: extfile.txt even if the drive where the cd is e:

to open the txt file i use this code:

Open App.Path & "ookmarks.txt" For Input As #1

any suggestion???

thanks in advance

ah... when executed from hard disk everything works fine

Run Time 401 Cant Show Non-modal Form When Modal Form Is Displayed
When i run the software i received this error, what will be the caused of this error ....
run time 401 cant show non-modal form when modal form is displayed


Thanks

Converting A Modal Form To Non-Modal And Vice Versa
Hi 2 All,

I am facing a very peculiar problem. I have one application which shows one form as modal. Then that form is calling a method in an referenced component and that intern shows another form as modal. Unfortunately, two modal forms can be displayed one top of the other. How do handle this?

Expecting experts to drop few lines.
Nazim.

Show &"Waiting&" Form (Non Modal) When Click On Button From Modal Form
Hi,

I have a modal form with a button. When I click on this button, it take a long time because it's doing a SQL query. During that time, I would like to show a form with a message on it to let the user know that it taking some time.

As the first form is modal (and it should be modal), I can't show the second form non modal (form2.show generate an error 401, because the first form is modal form.show 1).

If the second form is modal, it's doesn't show until the form load is fiinished. But I WANT that the form2 is shown in first and after proceed with some code in the form1.

How can I resolve my problem?

Thanks

Dominic Lavoie
City of Laval
Quebec, Canada

&"Run-time Error '401': Can't Show Non Modal Form When Modal Form Is Displayed&"
"Run-time error '401': Can't show non modal form when modal form is displayed"

That error is VERY annoying. How can I stop it?

Can't Show Non-modal Form When Modal Form Is Disp
Can't show non-modal form when modal form is displayed in vb 6.0.

Can't Show Non-modal Form When Modal Form Is Displayed
Within a timer, I tried to display a modal form but there is not any non-modal form that is going to be displayed. But I got this error "Can't show non-modal form when modal form is displayed". Any guru here can explain to me what might cause this problem. Thanks for your inputs!

&"Can't Show Non-modal Form When Modal Form Is Displayed&" Error!
Ok, I'm coding a game in VB6, and I have a slight error with the hall of fame...

When the program is ran in VB6 (Not Compiled), this problem doesnt happen. When compiled, is when the error occurs.

Here is the story...

You can acess the hall of fame two ways. One being from the main menu, the other being from when you die in the main game.

When acsessed from the main menu...

http://www.freewebs.com/vagjd/prob1.JPG

It works fine. It sorts the sequential files from highest to lowest, it works perfectly.

http://www.freewebs.com/vagjd/prob2.JPG

When acsessed from the game, when you get game over...

http://www.freewebs.com/vagjd/prob3.JPG

It gives this strange error...

http://www.freewebs.com/vagjd/prob4.JPG

.
.
.
.

Also, I'd like to note that when games is equal to false (User is acsessing the hall of fame from the main menu) is when the hall of fame works.


Quote:




Dim nmes(6) As String, times(6) As Variant, ttemp As Variant, ntemp As String, uname As String

'***note***, the variable games is globaled in a module, and
'is used to determine weather the user acsessed the hall of fame from the
'user losing in the game, or the user selecting hall of fame from the main
'menu

Private Sub cmdone_Click()
HallofFame.Hide
Menu.Show
End Sub

Private Sub Form_Activate()
If games = True Then
soundcheck = 1
Intro2.Show
Intro2.Hide
uname = InputBox("Please enter your name", "High Score Listing")
If uname = "" Then
uname = "Unnamed"
End If
End If


'Easy Settings
If opts(1) = 0 Then
lbltitle.Caption = " Hall of Fame Easy"

If games = True Then

'adds the new time to the file
Open App.Path + "ehighscore.txt" For Append As #1

Write #1, uname, thetime

Close #1

End If


Open App.Path + "ehighscore.txt" For Input As #1

x = 1

For x = 1 To 6
nmes(x) = ""
times(x) = ""
Next x

If games = True Then

For x = 1 To 6
Input #1, nmes(x), times(x)
Next x

Else


For x = 1 To 5
Input #1, nmes(x), times(x)
Next x

End If

End If


'Normal settings
If opts(1) = 1 Then
lbltitle.Caption = " Hall of Fame Normal"

If games = True Then


Open App.Path + "
highscore.txt" For Append As #1

Write #1, uname, thetime

Close #1

End If


Open App.Path + "
highscore.txt" For Input As #1

x = 1

For x = 1 To 6
nmes(x) = ""
times(x) = ""
Next x

If games = True Then

For x = 1 To 6
Input #1, nmes(x), times(x)
Next x

Else


For x = 1 To 5
Input #1, nmes(x), times(x)
Next x

End If

End If

'Hard Settings
If opts(1) = 2 Then
lbltitle.Caption = " Hall of Fame Hard"

If games = True Then


Open App.Path + "hhighscore.txt" For Append As #1

Write #1, uname, thetime

Close #1

End If


Open App.Path + "hhighscore.txt" For Input As #1

x = 1

For x = 1 To 6
nmes(x) = ""
times(x) = ""
Next x

If games = True Then

For x = 1 To 6
Input #1, nmes(x), times(x)
Next x

Else


For x = 1 To 5
Input #1, nmes(x), times(x)
Next x

End If

End If


Close #1


'Sorting Process

'If loaded after playing the game
If games = True Then


For y = 1 To 5

For x = 1 To 5


If times(x) < times(x + 1) Then
ttemp = times(x)
times(x) = times(x + 1)
times(x + 1) = ttemp

ntemp = nmes(x)
nmes(x) = nmes(x + 1)
nmes(x + 1) = ntemp


End If

Next x

Next y

'if loaded from the menu
Else

For y = 1 To 4

For x = 1 To 4


If times(x) < times(x + 1) Then
ttemp = times(x)
times(x) = times(x + 1)
times(x + 1) = ttemp

ntemp = nmes(x)
nmes(x) = nmes(x + 1)
nmes(x + 1) = ntemp


End If

Next x

Next y

End If

For x = 0 To 4
lblname(x).Caption = nmes(x + 1)
lbltime(x).Caption = times(x + 1)
Next x



'Writes the new highscore list to the file.

If opts(1) = 0 Then


If games = True Then

Open App.Path + "ehighscore.txt" For Output As #1

For x = 1 To 5
Write #1, nmes(x), times(x)
Next x

Close #1

End If

games = False


ElseIf opts(1) = 1 Then


If games = True Then

Open App.Path + "
highscore.txt" For Output As #1

For x = 1 To 5
Write #1, nmes(x), times(x)
Next x

Close #1

End If

games = False

ElseIf opts(1) = 0 Then


If games = True Then

Open App.Path + "ehighscore.txt" For Output As #1

For x = 1 To 5
Write #1, nmes(x), times(x)
Next x

Close #1

End If

games = False



ElseIf opts(1) = 2 Then


If games = True Then

Open App.Path + "hhighscore.txt" For Output As #1

For x = 1 To 5
Write #1, nmes(x), times(x)
Next x

Close #1

End If

games = False

End If

End Sub

Private Sub Form_GotFocus()
cmddone.SetFocus
End Sub

Private Sub Form_Unload(Cancel As Integer)
Unload Menu
Unload Intro2
Unload Instre
End Sub




.
.
.
.

Thanks in advance

Making Modal Form Truly Modal
I'm working in VB3 (I know!) but I think this applies to other versions of VB as well...

I have an MDI form which sometimes pops up modal non-MDI forms. When this happens, if the user gives focus to another application and then clicks on the icon of the MDI form, no action is permitted on the MDI form since another modal form is currently open.

What I need to know is how I can code/configure the program such that if the MDI form is selected from the taskbar when a modal form is opened, that the modal form is brought into focus on top of the MDI form.

This is donde in programs such as Word 97.

Thank you,
Craig Steiner

Open A Form In Access And Run A Code From That Open Form, From VB?
I wanna open a form in Access and run a code from that open form, from VB. Is that possible, if so, how?

Displaying A Non Modal Form On Top Of A Modal Form?
Forgive me if this is a dumb question. My searches turned up little.

What I need to do is display a form asking the user to stand by. This happens when they bring up a modal form from the main app (so three total forms). The 3rd form asking the user to stand by needs to be non modal since the 2nd form needs to do some lengthy communication processing. Of course, VB wont allow a non modal form to display when a modal form is already displayed... I cant just bring up the 3rd form first because the second form will periodically refresh the communication processing (at which time the wait message needs to be displayed again).

Anyone have a way of doing this? What am I missing??

How Can I Open Access From A Menu And Refresh The Form When Access Closes
Can any one tell why this doesn't work?

The problem is it works only after reopening access after
having edited and closed access once.

The Shellexecute works, so does the loop and
GetActiveWindow() works also, as do the refresh calls
and functions......


Short of running a timer refresh it is driving me mad!

I have two listboxes on my form which contain Data
I want to be able to Shellexecute to My Mdb to edit Data in
Access and return to my form with the Data in the two listboxes refreshed.



VB Code:
'the API's are dimmed in a module Public Declare Function ShellExecute Lib "shell32.dll" Alias _"ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, _ByVal lpFile As String, ByVal lpParameters As String, _ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long  Private Sub mnuOpenDB_Click()Dim lngdb As Long     Dim lhWnd As Long        lhWnd = GetActiveWindow()    'Should be the same as Me.hWndScreen.MousePointer = vbHourglasslngdb = ShellExecute(Me.hwnd, "open", "OrdOut.mdb", vbNullString, App.path, 1)If lngdb <= 2 Then    MsgBox "Unable to Find The Database.", vbExclamation, "The Database is Missing"End IfDo While lhWnd = GetActiveWindow()        DoEventsLoop EmData.Refresh EData.Refresh'this is a function LoadEmailListBox'this is another function 'both of the functions work well loadFileListScreen.MousePointer = vbDefault End Sub



wit respect

bindu

Open Access Form From A Password Protected Access Database Through VB
Iam using a password protected Access database. I can open the database with out any problem. There is a startup Access form associated with this database. I would like to open this form with out any prompt to the user for the password. When the program is run, the database opens twice. The first instance with the login screen prompting the user for the password. The second instance opens as desired. How to overcome this problem with the program opening the form only once.
Code:

Private Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
Private Declare Function GetKeyboardState Lib "user32" (pbKeyState As Byte) As Long
Private Const VK_NUMLOCK = &H90
Private Const VK_SCROLL = &H91
Private Const VK_CAPITAL = &H14
Private Const KEYEVENTF_EXTENDEDKEY = &H1
Private Const KEYEVENTF_KEYUP = &H2

Private Sub SafeSendkeys(ByVal keys As String, Optional bWait As Variant)
Dim keysBefore(0 To 255) As Byte
Dim keysAfter(0 To 255) As Byte
Call GetKeyboardState(keysBefore(0))

If IsMissing(bWait) Then
Call SendKeys(keys, False)
Else
Call SendKeys(keys, CBool(bWait))
End If
Call GetKeyboardState(keysAfter(0))

If keysBefore(VK_NUMLOCK) <> keysAfter(VK_NUMLOCK) Then
Call keybd_event(VK_NUMLOCK, &H45, KEYEVENTF_EXTENDEDKEY, 0)
Call keybd_event(VK_NUMLOCK, &H45, KEYEVENTF_EXTENDEDKEY Or KEYEVENTF_KEYUP, 0)
End If
If keysBefore(VK_CAPITAL) <> keysAfter(VK_CAPITAL) Then
Call keybd_event(VK_CAPITAL, &H45, KEYEVENTF_EXTENDEDKEY, 0)
Call keybd_event(VK_CAPITAL, &H45, KEYEVENTF_EXTENDEDKEY Or KEYEVENTF_KEYUP, 0)
End If

If keysBefore(VK_SCROLL) <> keysAfter(VK_SCROLL) Then
Call keybd_event(VK_SCROLL, &H45, KEYEVENTF_EXTENDEDKEY, 0)
Call keybd_event(VK_SCROLL, &H45, KEYEVENTF_EXTENDEDKEY Or KEYEVENTF_KEYUP, 0)
End If

End Sub
'Under a click event I have:
'************************
UserApps(AppAP).appRunPath = "C: estdb1.mdb"
If UserApps(AppAP).appAvailable = True Then LaunchFile (UserApps(AppAP).appRunPath)
hApp = FindWindow(vbNullString, "Password Required")
Call SetForegroundWindow(hApp)

Call SafeSendkeys("password", True)
Call SafeSendkeys("{Enter}", True)
'************************
What is wrong in my code?

Thanks in advance.
Rama

How To Open An Access Form From A Password Protected Access Database?
I have a password protected access database. I can open this database. Though the startup form (Access form) comes up, the database opens twice. One instance with the login screen for the password (since the database is password protected) and the other opens properly with the form. Can any one help in opening without the first instance occuring?

Code:
UserApps(AppAP).appRunPath = "c: estdb.mdb"
If UserApps(AppAP).appAvailable = True Then LaunchFile (UserApps(AppAP).appRunPath)
(AppAP).appRunPath, "password")
hApp = FindWindow(vbNullString, "Password Required")
Call SetForegroundWindow(hApp)
Call SafeSendkeys("password", True)
Call SafeSendkeys("{Enter}", True)


Thanks in advance,
Rama

Open Access Report From Ms Access Form
Hi all,
  I created one report in ms access. How can i open that report results from ms accesss form on command_click?
  please help me.


Thanks in advance
chitra

Would There Ever Be 2 Modal Forms Open?
Do I need to put a catch to make sure Im not loading 2 modal forms? Or can that never happens since the code freezes?

Modal/Non-Modal Form
When I run my code from VB I don't get this problem, but when I try to run the .exe I get an error that says "Can't show non modal form when modal form is displayed". I don't have anything set to non modal or modal. Can anyone help me?

Thanks!

Any Way To Determine If There Is A Modal Window Open?
I've 'inherited' an application that has an effectively fatal clash between some timer functionality and any application modal windows that happen to be open at the same time.

Now, unfortunately I cannot remove or change the timer functionality that causes the issue. As far as I can see that leaves me with toggle the timer every time I open a modal form, dialog or msgbox (ugh!) or determine programatically within the timer code whether there are any open modal windows. Obviously the latter is both easier and better contained if possible.

Does anybody know of a way to do this?

Access - Open Another Form
Hi,
I'm trying to open a modal,popup form as I click on an image from another form:


Code:
Private Sub Immagine3_Click()

Dim frmRiepilogo As New Form_Riepilogo

frmRiepilogo.etiQuanti.Caption = "TEST"
frmRiepilogo.Modal = True
frmRiepilogo.Visible = True

End Sub

I can just see the Riepilogo form appear and disappear in a jiffy. I put some debug.print on the form_load and form_close events of the Riepilogo form and all seems to work well (the event form_close seems to be called somewhere).
Any Hints?

Open An Access Form With A Vb App
Anyone know how to open an access database form through a visual basic application?

I dont believe I have seen this done yet.
thanks

Open A Form In Access From VB
I need to open an access form from a menu or button on a form in Visual basic. Any ideas??
itwg

Help How Can I Open A Access Form In VB
Is there anyone who can help me. I want to open some forms and reports who already made in access to open them with code from VB with a SQL statement that i also made in VB

Is this possible

How Do I Open My Access Form
Is there a way to open you're access form like you do say a word file through VB

(probably) But can anyone show me how, actually if this is possible, I want it to be the form only. I.e. the user of my program only sees the Access form, not the tables etc., they are hidden for all i care, I just want him to see the form. Is that also possible and how?

I'll probably give the user read-only rights as well

QC

Open Form In Access
I have asked this before, however still am lost!

I have written a code to select a record from the control form when opening a report to print. The isea is that the control form data is duplicated onto the report once the control button has been selected, from this the report containing the same data as the just entered recordset of the form will be displayed.
Below is the Code:-
DoCmd.Close acForm, "NCR Report3"
DoCmd.OpenReport "Scrap Ident Docket", acViewPreview, "Scrap Docket ID select", ID = [Forms]![NCR Report3]![ID]

DoCmd.Maximize
Beep
MsgBox "Place defective Item and NCR Docket on you're relevant quarantine area - OK to continue" _
, vbOKCancel + vbDefaultButton1 + vbInformation, "Deficiency Entered"

If Click = (1) Then
DoCmd.PrintOut acPrintAll, , , acHigh, 1, True
DoCmd.OpenForm "NCR Reporting2", acNormal, "", "", , acNormal
DoCmd.Close acForm, "Scrap Indent Docket"

Else
DoCmd.Close acForm, "Scrap Indent Docket"
DoCmd.OpenForm "NCR Report3", acNormal, "", "", , acNormal

Can anybody help, when the report opens it is blank

Detect If Any Modal Dialog Window Is Open
How can I go about detecting if Outlook has a modal dialog
window open or not? I need to test for this before my code starts
because I am invoking a modal dialog window in Outlook and if
one is already opened by the user the window I need opened will
not work. Since there are several different modal dialog windows
that can be invoked from Outlook I can not just enumerate
windows and look for a certain caption.

I am hoping that there is some way to detect if Outlook has
any "windows" open?

Thanks for any replies.

Open Form In Access Runtime
Hey all,
I am using VB(not VBA!) on a machine that has AccessRunTime. I am trying to open up a form, EditNumbers, in access from VB. I think this is possible, but I am not sure how to do it. I have tried using the "Access.Application" stuff, but I do not think that works on runtime. Any help would be much appreciated.

Open An Access Database From A Form
Hi All,
Do any of you know how to open an access database from a form?
For example, I want the access file xx.mdb to appear right before me after clicking a comand button. Can anyone give some advice??

Thanks

Open Access Form In A VB Application
Hi,

I have created an Access application with a form.

I want to make that form available while using my VB 6 application. Ideally, the access form would be displayed inside my vb application's form without showing the rest of the access application.

Does anybody have the trick for doing this?

Many thanks in advance,
Ben

Open An Access DB From A VB Form On Click
I need a 'short cut' button, if you will, that allows users to click to open
an Access Database--is that possible?

Tried Openfile, tried shell--if those are the answer, I didn't do them
correctly.

Thanks.



Tami Lawson
Data Analyst
Midway College
512 E. Stephens Street
Midway, KY 40347
(859) 846-5786

Open An Access Form From Within My VB Program
Hi
I am trying to open a form i have created (from within access) with my VB program i have loaded the references and can use the command:-
Docmd.openform mydatabase name,acPreview

however get the following error
object variable or with block variable not set

note the database i am using is allready open
and i can open a recordset and fill a flexigrid with the data produced by a query called from the same database and would use this however i need to display the some of the columns as yes/no boxes but when they display in the flexigrid it yes comes up as a -1 and no as 0
which is why i am trying to now do the same thing using an access form
the code i use for the flexigrid is as below

Option Explicit
Dim rcdFvAlarm As Recordset

Private Sub Form_Load()
    Set rcdFvAlarm = FvDb.OpenRecordset("Alarm_Viewer")
   
    Set Data1.Recordset = rcdFvAlarm
    MSFlexGrid1.ColWidth(1) = MSFlexGrid1.Width / 11
    MSFlexGrid1.ColWidth(2) = MSFlexGrid1.Width / 10
    MSFlexGrid1.ColWidth(3) = MSFlexGrid1.Width / 14
    MSFlexGrid1.ColWidth(4) = MSFlexGrid1.Width / 20

 Exit Sub

The form contains a flexigrid and a datacontrol called Data1
FvDb refers to the address of the database
As i say it works fine except it will not display the tickboxes shown in the access query
so i think ineed to use a form instead unless you know how to make it transfer the tickboxes
in their set state

i have run the form within access and it works

rgs
Norm

Check To See If A Form Is Open(access)
I have a form that is commonly used by a couple of other forms. when I close the single form I want to refresh the the one that called it, which is no problem.

The problem is, how can i tell if a form is open or not. i.e. if I want to refresh a form and it is not open I do not want an error outputted.

Hope that makes sense!!

How To Open MS Access Report In VB Form ?
Hi,
  I want to open an Access Report in Visual Basic. That is, Not through VB, but in a VB form . How do I go about it ?
  I don't want to create reports in VB through Crystal Reports. Just want to open a report created in Access in VB form.
Thanks in advance,
Meesam.

Access 2000 Form Does Not Open In Access 2002 Giving Error &"out Of Stack Space&"
Hi All,
I have seen the other posts related to stack errors but Iam unable to solve my problem. I have access 2k sql 2k project. All the forms work fine on my computer. When I install the project in access 2002, one of the forms does not open and access crashes. The first time it opened the form and after sometime gave error "out of stack space"
In the event viewer - application log reports "faulting application msaccess.exe,version 10.0.2627.1,faulting module msado15.dll,version 2.60.6526.0,fault address 0x.."
Please help.
Thanks,
avm02

Old Problem, Still No Solution? (modal Form Losing Focus When Parent Form Is Minimize
Hi everyone,


I have a problem with modal forms that's very easy to reproduce, and
practically locks up the application:


When closing Form1 I display a modal from (Form2), more or less to
request
the user if he's sure, etc. That works fine if Form1 is in normal
window
state and visible.
If I minimize Form1 in the windows Taskbar before closing it using the
system menu, Form2 appears, but is grayed and cannot receive mouse or
keyboard input. Because Form2 is displayed and modal, I cannot do
anything
else with the application. As far as the user is concerned, it's dead
and
frozen.


Form2 does not receive a Deactivate or LostFocus event, where I could
possible "repair" things.

Cheers, Marek

Normal Form And Dialog / Modal Form Sharing A Taskbar Item
My situation is I have a normal form (aka not a modal form), and a modal form that serves as an about window. When you show the modal form, all the items in the task bar lose focus. If you switch windows, and then go back to the 1 taskbar item for my program, again the taskbar item for my application loses focus and no taskbar item has focus.

I'm trying to make my application do the same thing as Word (for example). If you show the About window, the About window always has focus until you close it, but both the application window and the about form "share" the taskbar item, so when you click on Word in the taskbar, it doesn't lose focus.

Is this possible in Visual Basic 6?

Thanks in advance,
L. Whiteside

Block Form From Loading If Another Specific Modal Form Is Loaded [RE-SOLVED]
How can I block a Form from loading when another Form is loaded as Modal? The second Form is loading automaticaly if there is an error to report but if the Modal form is Loaded it's causing an error.

How can the program know that the first modal Form is Loaded before loading the second?

I've tried several approaches but non seem to work....

Thanks

_________________________________________________________________

Edited by - vbprog1144 on 8/7/2005 6:31:26 AM

Open File Dialog In Access Form
Hello,
I'm pretty good with VB but just learning VBA in access. I am working on a text import and have the import functions working, however I want to present the user with a file selection box so that they can select the text import file before the rest of my code imports the data. Normally in vb I'd add a windows common dialog control but I don't see that as an option in access. How would one go about adding an open dialog box on button click in access VBA?
Tom

Open Access Form And Goto Last Record??
Hi,
I'm very new to VBA and am trying to create a small sub for a button...when clicked it opens another form and goes to the last record. This only takes me to the new form -- what can I add to make it go to the last record? thank you.

Private Sub Command2_Click()
On Error GoTo Err_Command2_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "Mail Count"
DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_Command2_Click:
Exit Sub

Err_Command2_Click:
MsgBox Err.Description
Resume Exit_Command2_Click

End Sub

Add Records To Excel From Open Access Form
Hi:

I am a bit lost, but am trying to add about ten records to a new row in Excel, from an Access form, from Within Microsoft Access using VBA. Below is some incomplete code.

The question, how can I add a new ADO record in Excel (from Access), or look at Excel and go to the last row or next new row (in ADO - as I see examples for doing this inside Excel). And... how can I populate tjhe columns in the new row (B$, C$, D$, etc.)?

Thanks in advance for your help.


Private Sub cmdAppendToExcel_Click()

Dim cn As ADODB.Connection
Dim rsT As ADODB.Recordset

Dim rsC As ADODB.Recordset

Dim strQuery As String
strQuery = "SELECT * FROM Checklist$ "

Set cn = New ADODB.Connection
With cn
.Provider = "Microsoft.Jet.OLEDB.4.0"
.ConnectionString = "Data Source = c:DRCN.xls; " & _
"Extended Properties=Excel 8.0;"
.CursorLocation = adUseClient
.Open

End With



rsT.MoveLast
rsT.AddNew
' How can I add data for columns?
' c$ = Me.Doc_Number
' d$ = Me.Doc_Name
' h$ = Me.Revision
' k$ = Me.IssueDate
' j$ = Me.[Doc Owner]
' i$ = Me.Preparation
' b$ = Date
' e$ = Me.Doc_Level
' f$ = Me.DepCode
' g$ = Me.Doc_Type


rsT.Update


rsT.Close
cn.Close


End Sub

Open Form/query/table By Name (Access)
I'm using an Access DB and I have a form that gets the names of forms/queries/tables/etc from MsysObjects. This information is loaded into a Treeview. I want to be able to open a form and display the results of a query or contents of a table when one is selected. I'd also like to be able to insert subdatasheets into tables and queries and link the fields of choice.

I searched google for a while but didnt find anything useful.

Open An Access Form From A Batch File
I have created a database and I have a form that is used to update a table. I want to run this form from a batch file. How do I reference the form to be able to open it?

Thanks much,
Ricky

Copyright 2005-08 www.BigResource.com, All rights reserved