Form Properties

Waqas ali

Board Regular
Joined
Nov 6, 2010
Messages
163
Hi All,

i am new developer in access. before i have developed in excel different project as my office requirement now i started developing in access 2007.
kindly cooperate with to get professional skills in access. thanks to all

i want to know form tital bar property settings, from which property we can set it. hide or unhide to title bar, minimize button, maximize button and close button how can i set them.

second: how can i prevent text fields or combo box fields to update any changes on single form all controls from users. if any user want to update or change any field data when user close it one msg should appear to save the changes if yes than change in database if no than no changes should be update in database.

regards

waqas:rolleyes:
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
For Q2: I use the Form's Before Update event.

Example:

Code:
Private Sub Form_BeforeUpdate(Cancel As Integer)

 Cancel = False


' perform data validation
If IsNull(Me.CompanyName) Then

   MsgBox "You must enter a Company Name.", vbCritical, "Data entry error..."
      
   Cancel = True

End If


If Not Cancel Then
  ' passed the validation process

    If Me.NewRecord Then
        If MsgBox("Data will be saved, Are you Sure?", vbYesNo, "Confirm") = vbNo Then
            Cancel = True
        Else
            ' run code for new record before saving
        
        End If
    
    
    Else
        If MsgBox("Data will be modified, Are you Sure?", vbYesNo, "Confirm") = vbNo Then
            Cancel = True
        Else
           ' run code before an existing record is saved
           ' example: update date last modified
            
        End If
    End If

End If


' if the save has been canceled or did not pass the validation , then ask to Undo changes
If Cancel Then

    If MsgBox("Do you want to undo all changes?", vbYesNo, "Confirm") = vbYes Then
        Me.Undo

    End If
    
End If



End Sub
 
Upvote 0
Q1: About the Title bar ,etc.

Look at the form's property sheet under the format tab. Scroll down to Border Style. Starting with this property down to the Moveable property you can set then to meet your needs.
 
Upvote 0
hi all,
thanks very much.

i got minimize, maximize and close button on title bar with pop up property setting to yes.

kindly guide me about the difference between allow edits and data entry property.

i want to do when form is called or loaded user can not edit in any field but user can edit by clicking edit button. i want to put some code in button click event. how can i do kindly guide me.:confused:
 
Upvote 0
date entry = Yes means that you can not see any existing records. You can add records and view the records added since the form was opened. The mode is used you wan the user to only add records.

I use the form's Con Current Event to set the form's allow edits to no. When a user clicks the edit button it sets the allow edits to yes. The After update event can then set it back to No.
 
Upvote 0

Forum statistics

Threads
1,224,527
Messages
6,179,331
Members
452,907
Latest member
Roland Deschain

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top