Having problems with tabs and text delition

I think coding your way out of an intrinsically poor design is not really the way to go. 95% of the time the form is only there for review / informational purposes, so simply lock all the controls from editing.
Make the user expend a small amount of effort when then need to do the 5% task.
 
I think coding your way out of an intrinsically poor design is not really the way to go. 95% of the time the form is only there for review / informational purposes, so simply lock all the controls from editing.
Make the user expend a small amount of effort when then need to do the 5% task.

minty what do you mean?
 
I suggest you create a backend you can upload, upload your database in a new thread where maybe some other forum member can help you.

Ok so should I just upload here? we already started this thread to try to figured out this :S
 
Minty is saying that in software there can be traffic like a hallway. Users come in one door and stamp down a hallway to perform a task. If you put lumpy fragile address data in that hallway it will get stepped on, or people will have to walk around it and get pissed off, whatever, it's in the way. So now you can build a fancy container to protect your hallway dwelling address data, or you can just move it out of the hallway.
Of course I am paraphrasing.
Cheers,
 
Minty is saying that in software there can be traffic like a hallway. Users come in one door and stamp down a hallway to perform a task. If you put lumpy fragile address data in that hallway it will get stepped on, or people will have to walk around it and get pissed off, whatever, it's in the way. So now you can build a fancy container to protect your hallway dwelling address data, or you can just move it out of the hallway.
Of course I am paraphrasing.
Cheers,

I see;

Well I am trying to create a way where they cannot damage the data.

They work constantly with this data, lets say:

Copy/Paste customers phone numbers
Copy/Paste address
Copy/Paste drivers numbers
Copy/Paste company information

So I cannot just box the information away. But if I can contain the information where it is right now, and create a push button where they are protected unless they click it, then we can fix the situation, isn't???
 
Try this...
Code:
private sub form_open(cancel as integer)
   me.allowedits = false
end sub
Does that do what you want?
 
Or you could add a checkbox called chkAllowEdits to your form, and then do this...
Code:
private sub form_open(cancel as integer)
   me.chkAllowEdits = false
   chkAllowEdits_Click
end sub

private sub chkAllowEdits_Click()
    me.allowedits = me.chkAllowEdits
end sub
...and then by checking or clearing the checkbox your users can lock or unlock the form.
 
Or you could add a checkbox called chkAllowEdits to your form, and then do this...
Code:
private sub form_open(cancel as integer)
   me.chkAllowEdits = false
   chkAllowEdits_Click
end sub

private sub chkAllowEdits_Click()
    me.allowedits = me.chkAllowEdits
end sub
...and then by checking or clearing the checkbox your users can lock or unlock the form.

is that an afterupdate code or a click event????
 
Or you could add a checkbox called chkAllowEdits to your form, and then do this...
Code:
private sub form_open(cancel as integer)
   me.chkAllowEdits = false
   chkAllowEdits_Click
end sub

private sub chkAllowEdits_Click()
    me.allowedits = me.chkAllowEdits
end sub
...and then by checking or clearing the checkbox your users can lock or unlock the form.

I get a massive amount of errors. Idk if I am doing something wrong...
 
"Massive amount of errors," is not enough info from which to troubleshoot.
 
"Massive amount of errors," is not enough info from which to troubleshoot.


It asked me to enter a bunch of parameters, like:

CustomerID
CompanyF!CustomerID
txtTruckID

and then:
The expression on Open you entered as the event property setting produced the following error: Ambiguous name detected: form_open.


Those are the errors I got by just opening the Form View

Any ideas?
 
If you have just copied and pasted Markk's code you have probably created a duplicate form_Open event.

I think that you have probably got too many changes implemented - with trying Steve's code and Markk's all at once.

Go back to your original working form, and then upload a working version here, let someone have a look at it and we can work through the problem without the guess work about where you have got to.
 
If you have just copied and pasted Markk's code you have probably created a duplicate form_Open event.

I think that you have probably got too many changes implemented - with trying Steve's code and Markk's all at once.

Go back to your original working form, and then upload a working version here, let someone have a look at it and we can work through the problem without the guess work about where you have got to.

That's what I did. I erased everything and I am fixed at the same place. from where do I start?
 
Personally I would put a command button on the tab where your customer information is. Call it cmdUnlock.
Set all the textbox controls on the tab page that hold important info you don't want edited accidentally to locked.
In each of those controls there is a tag property. Put the text "AddressEdit" into the tag property (without the quotes) .

In the onclick event of the cmdUnlock butoon put the following;
Code:
Dim ctl As Control

Me.cmdUnlock.Caption = "Fields Unlocked"

    For Each ctl In Me.Controls
            If ctl.Tag = "AddressEdit" Then
            ctl.Locked = False
            End If
    Next

I would also add an event to the on change event on the tab pages to re-lock the controls and change the cmd button text back, so if they leave the tab page the fields are locked again.

You could use this on any tabbed page simply change the tag text for each set of controls.
 
Personally I would put a command button on the tab where your customer information is. Call it cmdUnlock.
Set all the textbox controls on the tab page that hold important info you don't want edited accidentally to locked.
In each of those controls there is a tag property. Put the text "AddressEdit" into the tag property (without the quotes) .

In the onclick event of the cmdUnlock butoon put the following;
Code:
Dim ctl As Control

Me.cmdUnlock.Caption = "Fields Unlocked"

    For Each ctl In Me.Controls
            If ctl.Tag = "AddressEdit" Then
            ctl.Locked = False
            End If
    Next

I would also add an event to the on change event on the tab pages to re-lock the controls and change the cmd button text back, so if they leave the tab page the fields are locked again.

You could use this on any tabbed page simply change the tag text for each set of controls.

Can I do this with a Check box??
 
You mean like Post #27, which starts off...
Or you could add a checkbox called...
This thread might be going in a circle. ;)
 
You mean like Post #27, which starts off...

This thread might be going in a circle. ;)

HA!!!!!!

Mark but I did try your Check mark and it did not work for some reason! :( Do i need to put it directly in the Navigation bar, or Can i put it outside? the problem is that I have multiple Tabs and I feel that having a check mark in each tab can be a bit confusing.
 
You mean like Post #27, which starts off...

This thread might be going in a circle. ;)

Mark;

The problem is that I have a code in the form already, and when I add your check box it doesn't let me open the database.

Here are the codes;

ON CURRENT:
Code:
Private Sub Form_Current()
'  If IsNull(Me.CustomerID) Then
'    Me.TabCtl85.Pages.Item("Customer").SetFocus
'    Me.CompanyF.Form.AllowAdditions = True
'  Else
'    If IsNull(Me.CompanyF.Form![CompanyID]) Then
'      Me.CompanyF.Form.AllowAdditions = True
'    Else
'      Me.CompanyF.Form.AllowAdditions = False
'    End If
'  End If
End Sub

ON LOAD:
Code:
Private Sub Form_load()
SetOption "Behavior Entering Field", 1  '1 = Goto start of field
End Sub

ON OPEN:
Code:
Private Sub form_open(cancel As Integer)
  Me.cboMC = Null
  Me.cboDOT = Null
  Me.cboCompanyName = Null
  Me.cboCustomerName = Null
  Me.Filter = "[CustomerID] =  0" ' don't show any info on load, then cbo's will refilter to show info
  Me.FilterOnLoad = True
End Sub


Could it be I have all this problems because this code is there?
 
So you add a checkbox to a form, and you can no longer open the database? Is that a correct description of the problem?
 
So you add a checkbox to a form, and you can no longer open the database? Is that a correct description of the problem?

I apologize Markk;

Once I put the checkbox and the event you gave me, the error is that It starts to ask me for all the parameters of the form;

CustomerF!CustomerID
CustomerID
DriverID
JobID
CompanyID

etc.... for some reason, the parameters get all fu**d when I create the checkbox with that specific event as open_form
 

Users who are viewing this thread

Back
Top Bottom