Minggu, 11 Desember 2016

Re: [MS_AccessPros] Re: Data Type for Mixed Data

 

Yes.  In a datasheet, the user can totally mess up the column widths.  In a Continuous Form (that you can lay out similar to a Datasheet with the labels in the header and the boxes underneath in detail), you control the width of the displays.  I also happen to think you can make a Continuous Form look nicer than a Datasheet.


John Viescas, Author
Effective SQL
SQL Queries for Mere Mortals 
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications 
(Paris, France)




On Dec 11, 2016, at 8:53 PM, david.pratt@outlook.com [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:



John, I don't understand what you are saying when you say I should use a continuous form so I have more control.  Are you saying that the subform should be a continuous form instead of a datasheet?


---In MS_Access_Professionals@yahoogroups.com, <JohnV@...> wrote :

David-

You need to be editing the subform by itself.

John Viescas, Author
Effective SQL
SQL Queries for Mere Mortals 
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications 
(Paris, France)




On Dec 11, 2016, at 7:04 PM, david.pratt@... [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:



John, 
I cannot select the Continuous Form mode when the form has a subform, so I am not sure what you are telling me that I should do.


---In MS_Access_Professionals@yahoogroups.com, <JohnV@...> wrote :

David-

I recommend you use a Continuous form - you'll have much more control over the layout.

These both go in the subform module:

Private Sub Form_Current()

    If Me.Numeric Then
        Me.ResultsTxt.Locked = True
        Me.ResultsDec.Locked = False
    Else
        Me.ResultsTxt.Locked = False
        Me.ResultsDec.Locked = True
    End If

End Sub

Private Sub Form_BeforeUpdate(Cancel As Integer)

    If Me.Numeric Then
        If IsNull(Me.ResultsDec) Then
            MsgBox "You must enter a result in the Decimal field."
            Cancel = True
        End If
    Else
        If Len(Me.ResultsTxt & "") = 0 Then
            MsgBox "You must enter a result in the Text field."
            Cancel = True
        End If
     End IF
End Sub




John Viescas, Author
Effective SQL
SQL Queries for Mere Mortals 
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications 
(Paris, France)




On Dec 11, 2016, at 2:10 PM, David Pratt david.pratt@... [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:



OK, that is an excellent idea!  What a resource you are.

However, I also have the issue with data that needs a < or > input, when the data is below or above the detection limit of the test.  Can you guide me further through doing this?

In my tblServiceReportDetails, where I now only have one Results field which is a ShortText, I will have to modify that table so there is both a ResultsTxt field and a ResultsDec field.

In my Parameters table I will add two descriptive fields
  • One field is a Yes/No named Numeric with default YES
  • One field is named Comparator.  It needs to be a List with choices of "=, <, > "

The input form will contain the Comparator field and the user will have to select the comparator for each result, but the default is "=" so input is easy.  I probably will not even include a Tab Stop on that field since it is seldom that the Comparator is anything other than "=".  Any reports will need to concatenate the Comparator field and Result field, but hide the comparator if the comparator is "=", and also hide the Comparator if the Result is a text.  I will have to delay thinking about how to do this until later.

For now I need more guidance on the input form (datasheet based on tblServiceReportDetails).  If the Parameter in the current record has Numeric = Yes, I want to force the user to input into the ResultsDec field, and if the Parameter in the current record has Numeric = No, I want to force the user to input into the ResultsTxt field.  Can you give more details on how to code this and on what Event?

Thank you,
David












__._,_.___

Posted by: John Viescas <johnv@msn.com>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (9)

Have you tried the highest rated email app?
With 4.5 stars in iTunes, the Yahoo Mail app is the highest rated email app on the market. What are you waiting for? Now you can access all your inboxes (Gmail, Outlook, AOL and more) in one place. Never delete an email again with 1000GB of free cloud storage.


.

__,_._,___

Tidak ada komentar:

Posting Komentar