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




Trying To Stop A Form Moving


hi, i am making a program that has docking forms onto the main mdi form. I am trying to make it so that the forms can be docked and undocked. I have so far made a timer that keeps a form in its position all the time but when the user tries to drag the form it flashes and such and then returns to the position wheras i don't want it to move at all, is there any way i can subclass it to stop it moving?




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Stop Maximized Form From Moving
I am using a picturebox as a container to act as a mdiparent because only 1 midparent is allowed when I need 2. When I maximize a "child" form, the title bar is still visible which enable the user to move the max form. I get an error when I set moveable=false during runtime. Is there any way to stop the maxed form from moving? Thanks.

Stop Txt Moving
can any1 tell me how u stop txt that is in side a pic box moving ever thing u click in the box

Pic Box, Object To Stop Moving
what im trying to do is make it so that i have one bit picture box and a pong design interface inside it(this is a final assignment im making a variation of pong) anywho what im trying to do(and tryed everything i've thought of) is to get it so that when you drag the padel down it cannot pass the line at the top or the bottom, and both these lines are drawn, not made at runtime. thanks for help

also after you hit the line you cannot go down or up further then the line, and you can continue moving inside the two lines

How Do I Make A Shape Stop Moving?
I have a shape(Shape1) that you can move with the arrow keys....how do i make the Shape1 cease to move when a certain event happens, even though the arrow keys are still pressed?


thanks for any help!

ListView - Stop Icons Moving
Hi,
I'm using a listview control in the Icon mode, to display a control panel for my application. The only problem is that when a user clicks an icon, when you move the mouse it moves the icon as well.

Is there any way to stop the user moving the icon?

How Do I Stop Flickering In Moving Graphics?
I haven't dealt with graphics in vb before, but I know of a common graphics method to reduce/eliminate flicker in animations called double-buffering.

The flicker is caused from clearing the old frame before drawing the new one. To counter this problem you actually would have 2 picture boxes (or whatever you're using) the first one is the visible one that will display the animation. On the second buffer, you do the calculations for the next frame and place all the objects there, then once the frame is ready for display you change the image on the visible buffer to that of the second buffer.

Since I haven't done this in vb before I'm not to helpful in the code department, but hopefully you'll find this method usefull.

Trying To Stop Moving Past Last Record
I am writing a database with a number of tables with forms atttached to each table. I have placed navigation buttons on each form to move to first, last, next, previous. I have set up the code associated with the buttons as "public sub" so it is available for each form to use.

This was working OK except that when I used the NEXT button at the last record it would open a new blank record & keep opening a new blnak record on each click.

To over overcome this I put in an If statement to check if it had moved to a new record. To do this I used the following:

If Me!NewRecord Then ..... etc

Now I get an error "Invalid use of Me key word" I suspect it is because I am using ME in a public sub

How do I overcome the problem of moving passed the last record and still have the coding available to all forms?


The Code is below.

Thnaks for any help.


Public Sub Next_Record_Click()
On Error GoTo Err_Next_Record_Click

    DoCmd.GoToRecord , , acNext

If Me!NewRecord Then
    ' If new record move back to previous
    DoCmd.GoToRecord , , acNext
    ' Send message
    MsgBox "This is the last record", , "No More Records"
    
End If


Exit_Next_Record_Click:
    Exit Sub

Err_Next_Record_Click:
    MsgBox Err.Description
    Resume Exit_Next_Record_Click
    
End Sub

Stop User Moving The Chart Around In MsChart
VB6 SP6

I am using MsChart. I need to allow selections but when this is set to True users can click on the chart and move the plot area around the unplotted area.

Anybody know a way to avoid this

Thanks

Stop Item Dragging/moving In ListView
Is there any way you can stop the user from moving the item position in a listview?? I need them to stay the same as i added them first by code, with them being fixed for the user and not allowing any movement of item position!

thanks!

Stop A Moving Image Drawing Over Other Lines...
I have the following code which moves a little image control across the form, but what happens when it moves across slowly is it sort of half draws over lines that I have on the form....how can i get it so that it doesnt draw over the other lines and leaves them intact....so that it doesnt leave this kind of trail.....


VB Code:
Private Sub Timer1_Timer()If Image2.Left < 9240 Then Image2.Left = Image2.Left + 1'only move the picture one space over if it isnt alreadt at the desired locationEnd IfEnd Sub

How To Stop Cursor Keys Moving Focus ?
I am writing a program where an object can be moved round the screen.  I first did this using command buttons and then wanted to add the option of using the keyboard cursor keys.

KeyAscii and/or KeyCode worked for most keys but not the cursor keys which didn't seem to generate any events.  I got something working using an API call (GetAsyncKeyState).

The bit which still bugs me is that when the user presses the cursor keys, as well as moving the on-screen object, it also moves focus round the various command buttons.

Can anyone suggest how to stop this happening ?



Making A Label Stop Moving When It Hits A Certain Point[solved]
I have a long Label, it shows text, I want it to scroll slowly, but how do I make it stop at a certain point, If I do


VB Code:
Private Sub tmrAbout2_Timer()        DoEvents        LblAbout.Top = LblAbout.Top - 10        DoEventsIf LblAbout.Top <= 0 Then tmrAbout2.Enabled = FalseEnd Sub


Then it stops when the top of the label hits the top of the form/frame, I want it to scroll through the top of the frame, Its fine if I dont put an If then but it keeps going forever.

Stop Code From Moving On If &"IF&" Statements False [Solved]
hi, i want to verifi the first two boxes before it moves onto the rest of the code so if any of the first two if statements are false it doesnt move onto the rest of the code, any 1 have any ideas?

thx much appreachiated


Private Sub cmdcal_Click()

If cboCars = "" Then MsgBox "Error Msg Here"
If txtdays = "" Then MsgBox "Error Msg Here"

lbltotal = lblPrice * txtdays
lbldeposit = (lbltotal / 100) * 20
lblPay = lbltotal - lbldeposit

End Sub

How To Check That Form Is Loded Or Not? And Also How To Stop Flikering Of Child Form?
Hii Friedns,

How to know that desire form is loded or not during run time?

and in my project i am using MDI form. During run time i am changing size of child form. But it does not look very good when it opens child form. How to give snappy look to that? It also takes to much time to load form.

Thanksin advance.

Hdave.

Conflicting Names - Moving Controls Of An Object Form To An MDI Form
Hello,

I have two simple question:

1.
I have added to my project a form saved as frmTEST.frm; and i don't know what i have made so now i receive a message error which is:
"Conflicting names were found in 'C:frmTEST.frm'. The name 'frmTest' will be used."
And in the project explorer window i have under 'Forms' folder : frmTEST(frmTEST.frm)

Can anyone tell me how to stop this message error ?? I tried to use Help button under error message window, but still don't know how to fix the problem.

2.
How can i Copy the controls on the object of my form to a new MDI Form ??
I receive an error such as "control don't have align property...error loading clipboard..."

Conflicting Names - Moving Controls From A Form To An MDI Form
Hello,

I have two simple questions:

1.
I have added to my project a form saved as frmTEST.frm; and i don't know what i have made so now i receive a message error which is:
"Conflicting names were found in 'C:frmTEST.frm'. The name 'frmTest' will be used."
And in the project explorer window i have under 'Forms' folder : frmTEST(frmTEST.frm)

Can anyone tell me how to stop this message error ?? I tried to use Help button under error message window, but still don't know how to fix the problem. I tried also to change the name of the form but no solution.



2.
How can i Copy the controls on the object of my form to a new MDI Form ??
I receive an error such as "control don't have align property...error loading clipboard..."

Form Stop
I have a splash screen in my program, its the first thing to load up when the program runs.

It will connect to the server, download updates, then run the main form which is a MDI form.

The problem is sometimes, for i have no clue why, it will load up the MDI form, but i cant keep focus on it.. I'll click it, and the title bar will turn gray, and it keeps doing that.. So i hit Ctrl+Break and i can see its constantly running through code on the splash screen! So i F8 through it to see whats triggering it... And i dont see anything...!! It starts in 1 section where it unloads the splash and loads the MDI form, which just so happens to me in the middle of an IF..Then statement after changing a lablel, but it starts in the random spot for i dont know why... ugg...

Then it moves on and goes through a Delay sub, then it goes through the Unload portion of the form a few times, then it goes back to the middle of that If.. Then statement, and when it hits End Sub, it starts on frmLoad!!

Looking through my code, i dont have a single line of code ANYWHER that loads that splash screen... I set the interval of the only timer on the form to 0 and disable it when its supposed to close that form, its not inside any loops, becuase there arent any loops (except for whats in the Delay sub), i close both winsock controls.. But it still loops through it all!

Is there a way to force close a form and make it cancel everything its doing? Or is there another fix for this problem?

Stop A Form
Is there a way to stop a form without stopping the whole program by using an end on a hard error.

If the user encounters certain types of errors I issue a rollback and then I want the form to unload and stop running. I cant just call an unload because after it goes through the unload process it moves into the next bit of code in that form. I need something that functions the the End does but only for that form.

Is this possible???

Stop Form From Continuing
Hello again.

On my form. I have a combobox with a list of names. The default text of this is "Please select a document."

Sometimes, when using this form, it's difficult to remember to drop the list down and pick a document. So I want to stop the form from adding data into the sheet when that option is selected.

This is my code so far.


Code:
Private Sub DisplayCmd_Click()

If DocLst.Value = "Please Select A Document ..." Then
Call InvalidDocProc
End If

..
..
..

End sub

Sub InvalidDocProc()

Message = MsgBox("You have not selected a valid document", vbOKOnly, "Invalid Selection ...")

End Sub
But when try to select this document, I get the message box, but then it just carries on with the DisplayCmd sub.

I don't want to exit the form, I just don't want it to continue. Is there anything I can do?

Stop Form Load
How can I stop a form load. I have an input box in a form load event which takes a value searches a database and displays the info on the form. If the user clicks cancel on the inputbox, how can I stop the form load?

Stop A Form From Unloading
I have a form with a media player on it (not the main form) and I want to stop it form unloading when the user closes it and just hide it instead, Me.Hide. I think I should be able to put some code in Form_QueryUnload to do this, but I don't know what.

Edit: The reason for this is so it will keep playing.

Stop Form Resizing
Is there a way to stop the form being rezied completley.
And is there a way to disable to resize corner thing in a status bar.

I know you can take away the min and max buttons, im talking about the program being a fixed size no matter what.

Thanks
-Dave

Stop Form Process
Ok i have a few forms.

How can I stop the other forms from loading when I want only the main form to be loaded??

I will load other form only when i call them.

Stop Form Updating
I do some fairly complex manipulations of many of the controls on my form,
including location and size (even the size of the form itself). I want to
disable all screen refreshes until all this is complete, and just display
the result at the end. How can I do this? LockWindowUpdate does not do the job.

Stop MDI Form Being Resized
I have done a search on this and the only answer I can find is to subclass the form, so I have copied the code to a new module and changed the Private to Public (I think I have to do this)

It doesn't seem to do anything.

I don't confess to understand a lot of this code, so if somebody could explain what is wrong, and if possible, why as well please.

Here is the code in total:

vb Code:
Private Sub MDIForm_Load() 'Save handle to the form.gHW = Me.hwnd'Begin subclassing.Hook End Sub Option Explicit Private Const GWL_WNDPROC = -4Private Const WM_GETMINMAXINFO = &H24Private Type POINTAPI    x As Long    y As LongEnd Type Private Type MINMAXINFO    ptReserved As POINTAPI    ptMaxSize As POINTAPI    ptMaxPosition As POINTAPI    ptMinTrackSize As POINTAPI    ptMaxTrackSize As POINTAPIEnd Type Private Declare Function SetWindowLong Lib "user32" Alias _            "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, _            ByVal dwNewLong As Long) As LongPrivate Declare Function DefWindowProc Lib "user32" Alias _            "DefWindowProcA" (ByVal hwnd As Long, ByVal wMsg As Long, _            ByVal wParam As Long, ByVal lParam As Long) As LongPrivate Declare Function CallWindowProc Lib "user32" Alias _            "CallWindowProcA" (ByVal lpPrevWndFunc As Long, _            ByVal hwnd As Long, ByVal Msg As Long, _            ByVal wParam As Long, ByVal lParam As Long) As LongPrivate Declare Sub CopyMemoryToMinMaxInfo Lib "KERNEL32" Alias _            "RtlMoveMemory" (hpvDest As MINMAXINFO, ByVal hpvSource As Long, _            ByVal cbCopy As Long)Private Declare Sub CopyMemoryFromMinMaxInfo Lib "KERNEL32" Alias _            "RtlMoveMemory" (ByVal hpvDest As Long, hpvSource As MINMAXINFO, _            ByVal cbCopy As Long) Global lpPrevWndProc As LongGlobal gHW As Long             Public Sub Hook()'Start subclassing.lpPrevWndProc = SetWindowLong(gHW, GWL_WNDPROC, AddressOf WindowProc)End Sub Public Sub Unhook()Dim temp As Long'Cease subclassing.temp = SetWindowLong(gHW, GWL_WNDPROC, lpPrevWndProc)End Sub Private Function WindowProc(ByVal hw As Long, ByVal uMsg As Long, _                    ByVal wParam As Long, ByVal lParam As Long) As Long                    Dim MinMax As MINMAXINFO'Check for request for min/max window sizes.If uMsg = WM_GETMINMAXINFO Then    'necesary for the caption of an MDI child (when maximized)    WindowProc = CallWindowProc(lpPrevWndProc, hw, uMsg, wParam, lParam)        'Retrieve default MinMax settings    CopyMemoryToMinMaxInfo MinMax, lParam, Len(MinMax)        'Specify new minimum size for window.    MinMax.ptMinTrackSize.x = (6000 / Screen.TwipsPerPixelX)    MinMax.ptMinTrackSize.y = (7365 / Screen.TwipsPerPixelY)        'Specify new maximum size for window.    MinMax.ptMaxTrackSize.x = Screen.Width    MinMax.ptMaxTrackSize.y = Screen.Height        'Copy local structure back.    CopyMemoryFromMinMaxInfo lParam, MinMax, Len(MinMax)    WindowProc = DefWindowProc(hw, uMsg, wParam, lParam)Else    WindowProc = CallWindowProc(lpPrevWndProc, hw, uMsg, wParam, lParam)End If End Function

Stop MDI Form Unloading
I have a MDI ChildForm where a user may or may not have made changes.
I want to check, when the actual MDI Form is closed, if the user wants to save any changes made to the MDI ChildForm.

Firstly, if there have been any changes then the boolean value is set - blnUpdate.

Then there is a msgbox asking if the user want to save the changes.
Here is where I have the problem.
If the user selects 'OK' to save the details the following code runs, but then goes straight to the MDI Forms Unload event.

My code in the ChildForm QueryUnload is:

vb Code:
If blnUpdate = True Then   If MsgBox("You have made changes to the member's details." & vbCrLf & _            "To save the changes select 'OK'." & vbCrLf & _            "If not select 'Cancel'.", vbOKCancel + vbInformation, "Update details") = vbCancel Then            'don't save changes - close form            blnUpdate = False            MDIMain.sb1.Panels(3).Text = ""    Else            'save changes            If UnloadMode = 1 Then                Cancel = True            End If            Me.ZOrder 0    End IfEnd If

How To Stop A Form From Closing
Hi,

The code below is what i use to unload all forms,


VB Code:
Dim frmcurr As Form   For Each frmcurr In Forms    Unload frmcurr  Next frmcurr

The problem i've got now is that i need all forms except one to unload, can a few lines be written into the above code to exclude one certain form or will i need to bin the above code and unload the forms seperately.

Thanks
Steve.

Stop Form From Redrawing?
Have a project with MDI stuff happening, before I can close the app or any child forms, they need to be restored (if they've been minimised) to store their last locations/states. My customer doesn't want to see the forms restoring before they're closed - any way to restore them invisibly?

How Do You Stop A Form Appearing More Than Once?
How do you stop a form appearing more than once?


VB Code:
If BridAtLeft = True ThenUnload frmLevel2MyGame.ShowElseBridAtLeft = FalseExit FunctionEnd If


Here is my code for unloading a form and going to anther. The problem is MyGame form keeps appearing , how do I disable it after its appeared once?

Stop Resizing Form
Can someone give me a pointer in how to avoid the form being able to resize without losing the clip controls or adjusting the border, e.g. I want to keep the minimize button.

Resizeable Form... Can't I Stop It ? :(
well i have made it so Max Button isn't work but even Window of my program is resizeable ( in .exe )

u undertsand me ?

please help...

How Can You Stop Form Flickering?
im using a manifest file to have a xp style for my app, but it keeps flickering whenever i move over a control that has been "styled"

how can i stop this?

Stop Resize Form
how could i stop users from resizing the form??

Stop A Form From Exiting
I have form 1. and form2. form1 is using form2 to display a progressbar. but if the user clicks the X on form2 form1 throws up and error in the loop cuz it cant read the progress bar since the 2nd form was closed... is there a way to stop form2 from closing untill the loop in form1 is done?
thanks,
gabe

How To Stop A Form From Refreshing?
Simple enough, yet I can't seem to remember how to do it.

Heeeeeeelp...

How To Stop MDI Form To Get Maximize ??
is there any way to stop MDI form to be maximized .. i want to disable the maximize button of MDI form and want to stop Resizing of MDI form also !!! any way to do this or any API Function to do this ??

How To Stop A Form From Unloading?
I have another minor problem - I have a form that is supposed to check whether the users have changed anything without saving, when they close the form by clicking on the X button.

I can do the check easy enough, but here is the problem.

The form validates that the user has entered ALL the relevant info, and if not, puts up an info style message box to inform them that they need a certain piece of info. This is being called from the Query_Unload event, and that bit is working.

When the user clicks "OK" control is *supposed* to be returned to the form that is being unloaded, but it is still closing.

Any ideas?

Currently I have:


Code:

Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
Dim msg As String

msg = "You have unsaved changes. Do you wish to save them?"

If mbDirty Then
If MsgBox(msg, vbYesNo, "Unsaved changes") = vbYes Then
pSave
End If
End If

End Sub

Public Sub pSave()
On Error GoTo ErrTrap

If UBound(arrTxt) > 0 Then
If Not fUpdateCommitment Then
Me.Show
End If
End If

Exit Sub

ErrTrap:
Screen.MousePointer = vbDefault
pErrHandler Err.Number, Err.Description, errSeverity, Me.Name & ".pSave"
Err.Clear

End Sub

Private Function fUpdateCommitment() As Boolean
'<snippity snip>

fUpdateCommitment = False



If rdoProfile.value Then
' Attempting to save Profile
If Len(Trim(txtProfile.Text)) = 0 Then
MsgBox "Profile Name must be defined.", vbInformation, Me.Caption
Exit Function
End If
Else
'Attempting to save Profile
If Not Len(sCommencementDate) = 0 Then
lDays = DateDiff("d", dtDateTime, CDate(sCommencementDate))
If lDays < 0 Then
MsgBox "Commencement Date can not be in the past.", vbInformation, Me.Caption
Exit Function
End If
Else
MsgBox "Commencement Date must be defined.", vbInformation, Me.Caption
Exit Function
End If
End If

' does other stuff similar to the above, exiting the function if anything fails validation

fUpdateCommitment = True
Exit Function
errTrap:
'other error trapping stuff
End Function

How To Stop Form Unload
dear friends


is there any method through which i can stop unloading the form even after when the "unload me" is executed?????

thanx in advance
vishal

Argh, Can't Stop Form!
I've got a one form multiple sub application. When a button is clicked, I have an ordered list of sub calls. On error, I want the application to display the error, and then quit. I've read that using END is bad, so I've avoided it. When there's an error, I call a central error displaying sub, and then at the end, say "Unload Me".

The problem is Me isn't unloaded I mean, it sorta is... I have the forms collection on a watch window, and I see it supposedly go away. The unload even is triggered. It just seems the terminate isn't. The code goes through the cleanup routine I send it to from the unload event, then cycles out of it and the unload event's code. And then it returns back to my "main" list of calls, and merrily continues executing! What's going on with this?! It's like it ALMOST unloads, but the code keeps going

Ending A Form, But Not Stop The Whole Program.
How can I close a form without ending the whole program?

Stop Events While Displaying Form
Can anyone please tell me how I can stop all events while another form is being displayed? Is it possible?


Thanks!

How Do I Stop My Form From Temp Freeze?
I am making a program, and it has an API, and while the API is doing what it does, it freezes the form/program until the API is done. I can't click anywhere on the form or anything... Is there any way to stop this from happening? Please help, thanks!

Stop Form From Dragging Off-Screen
I've searched this quite a bit and keep coming up with the same results... all of which don't really solve the problem...

I have a form that I want users to drag, however, I do not want the form to cross the edges of the screen. That is, I do not want any part of the form to disappear outside the screen. The only code I've found close to this is one to snap the form to the edge of the screen (while still allowing it to be pushed outside the screen).

I've tried using the mouse position API for the form, but it doesn't capture the X and Y coordinates for when you're over the form's border. I understand this to only see the INSIDE of the form, and not the form's border included.

Thanks in advance!

Stop Code Without Closing Form
I have a login and if the user has not enterd a login ID for the program i want to tell them that they haven't and then stop the login process.

The login process requires the login ID for it to access the data file with the login details so if it carrys on running then it produces an error.. any ideas?


Code:
Dim Emp1 As Employee
Dim i As Integer

Open App.Path & "EmInfo.dat" For Random As #1 Len = Len(Emp1)


If txtstaffID = "" Then
MsgBox "Staff ID Required"
Stop ' ??

End If


i = txtstaffID

Get #1, i, Emp1
If txtpassword.Text = Trim$(Emp1.AccountPassword) Then
If Trim$(Emp1.AccountType) = "Admin" Then
frmAdminMenu.Show
frmAdminMenu.lblid.Caption = txtstaffID
frmLogin2.Hide
Else
frmReceptionmenu.Show
End If
Else
MsgBox "Incorrect User Name Or Password!"
End If
Close

Stop Flickering On Form Load
I have a listview on one form, and when the user clicks on one of the listitems, it loads that persons details into a second form, which has a listbox and approx 20 textboxes on it.

I have tried hiding the second form until it's loaded and I have tried using the LockWindowUpdate on both forms, but I still get a terrible flicker of the second forms textboxes etc.

Any comments will be most welcome.

Here is my code. Please bear with me as it may be a bit rough

This is the code for the listview click event.
Below is the sub for loading the second form (LoadDetails)

Code:
Private Sub lvwIns_Click()
On Error GoTo ErrTrap

'stop error if no records to show
If blnRecords = False Then Exit Sub

'stop if user not clicked on any item - empty white space
If TypeName(lvwIns.HitTest(sglX, sglY)) = "Nothing" Then
lvwIns.SelectedItem = Nothing
Exit Sub
End If

Dim lvwItem As ListItem
Dim RecNum As Long

'get the memb_ID number from the listview
RecNum = lvwIns.SelectedItem.SubItems(4)
'set boolean to stop error re-loading the form
FromLoadDetails = True

frmMembershipDetails.Visible = False
LockWindowUpdate frmInsuranceRenewals.hWnd

LoadDetails RecNum

'add the name of the selected members name to the text box (txtSearch)
Set rs = New ADODB.Recordset
Set cn = New ADODB.Connection
cn.ConnectionString = strConnection & App.Path & "Membership.mdb"
cn.Open

strSQL = "SELECT Memb_ID, First_Name, Middle_Name, Surname FROM tbl_Membership"
strSQL = strSQL & " WHERE Memb_ID = " & RecNum
rs.Open strSQL, cn, adOpenForwardOnly, adLockReadOnly, adCmdText

Dim strTemp As String
If rs!Middle_Name.Value = "" Or IsNull(rs!Middle_Name.Value) Then
strTemp = rs!First_Name.Value & " " & rs!Surname.Value
Else
strTemp = rs!First_Name.Value & " " & rs!Middle_Name.Value & " " & rs!Surname.Value
End If

rs.Close
cn.Close
Set cn = Nothing
Set rs = Nothing

FromLoadDetails = False

'add name and highlight
If lngSearch = 1 Then
frmMembershipDetails.txtSearch.Text = strTemp
frmMembershipDetails.txtSearch.SelStart = 1
frmMembershipDetails.txtSearch.SelLength = Len(frmMembershipDetails.txtSearch.Text) - 1
End If

'open new form
frmMembershipDetails.Visible = True
LockWindowUpdate 0&

Exit Sub


LoadDetails sub:

Code:
Public Sub LoadDetails(MembersID As Long)
On Error GoTo ErrTrap

LockWindowUpdate frmMembershipDetails.hWnd

'load form to stop rs, cn error of being closed
frmMembershipDetails.Visible = False

Set rs = New ADODB.Recordset
Set cn = New ADODB.Connection
cn.ConnectionString = strConnection & App.Path & "Membership.mdb"
cn.Open

strSQL = "SELECT * FROM tbl_Membership"
strSQL = strSQL & " WHERE Memb_ID = " & MembersID
rs.Open strSQL, cn, adOpenForwardOnly, adLockPessimistic, adCmdText

frmMembershipDetails.txtMembership(0).Text = rs!First_Name & ""
frmMembershipDetails.txtMembership(1).Text = rs!Middle_Name & ""
frmMembershipDetails.txtMembership(2).Text = rs!Surname & ""
frmMembershipDetails.txtMembership(3).Text = rs!Street & ""
frmMembershipDetails.txtMembership(4).Text = rs!Town & ""
frmMembershipDetails.txtMembership(5).Text = rs!City & ""
frmMembershipDetails.txtMembership(6).Text = rs!County & ""
frmMembershipDetails.txtMembership(7).Text = rs!Post_Code & ""
frmMembershipDetails.txtMembership(8).Text = rs!Home_Tel & ""
frmMembershipDetails.txtMembership(9).Text = rs!Mobile_Tel & ""
frmMembershipDetails.txtMembership(10).Text = rs!Email & ""
frmMembershipDetails.txtMembership(11).Text = rs!DOB & ""
frmMembershipDetails.txtMembership(12).Text = rs!Date_Joined & ""
frmMembershipDetails.txtMembership(13).Text = rs!Insurance_Due & ""
frmMembershipDetails.txtMembership(14).Text = rs!Grade & ""
frmMembershipDetails.txtMembership(15).Text = rs!Last_Graded & ""
frmMembershipDetails.txtMembership(16).Text = rs!Membership_Number & ""
frmMembershipDetails.txtMembership(17).Text = rs!Occupation & ""
frmMembershipDetails.txtMembership(18).Text = rs!Notes & ""

'reset boolean for txt changed
blnUpdate = False

rs.Close
Set rs = Nothing
cn.Close
Set cn = Nothing

frmMembershipDetails.cmdClear.Enabled = True
frmMembershipDetails.cmdPrint.Enabled = True
frmMembershipDetails.cmdUpdate.Enabled = True
'frmMembershipDetails.Visible = True

LockWindowUpdate 0&

Exit Sub

Stop Changing The Size Of The MDI Form
MDI form in my project is in 'Maximized' windowstate. I want it to be remain on that state without being to 'Normal' state. How can I do this?

Can't Stop Form From Loading &lt;Resolved&gt;
Hello

I have several forms that do the same thing but just present a different format for the user. The user decides what format they want to work with and that is the form that is loaded. So I decided to put all the common code into a module to cut the size of the exe, streamline things and make it one stop shopping for mods to the code.

The code in the module checks controls on the form for the data to do it's calculations with. Now for the problem:

When the code in the module checks the state of controls on the form, the form gets reloaded all over again for each and every control that is tested.

This has created 2 problems:
1. Some of the things that the formload does mess up the subsequent operations in the module.
2. With close to 100 controls that can be queried this is a lot of overhead.

So my question is this is there a way to stop an already loaded form from being reloaded every time a remote procedure accesses one of it's controls?

I don't know if it makes a difference but I put all the common code into the module1.

Thanks

David

Errhandle - Stop Form Loading
I have a errhandle command in the form_load event of my form.

If the the errhandle function is called, I want the form to stop loading and, in fact, unload.

I've tried:


Code:
unload me

and/or

Code:
exit sub


and a few other things but they either come up with an error saying object was unloaded or the form doesn't unload at all.

Any ideas how I can stop the form continuing to load?

Thanks

Simon

Function Won't Stop... Even After It's Form Is Unloaded!
Alright... wierd deal.

I have a public function on a form (a download progress form) that I call from another form. Now statements execute normally in that function... but if I click the close box the form unloads (I set the form = Nothing in the Form_Unload event) the statements still execute!

Windows calls an IBindStatusCallback_OnProgress event repeatedly in my program. This might be why the statements in that function keep going even after I have unloaded it!

What can I do to stop the rest of the statements in that function from executing after the form has been unloaded?

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