Sabtu, 31 Desember 2016

[MS_AccessPros] Default Value

 

I am trying to set a default value into a "bottles required" text box control based on the value of the fourth column of a combo box.  I was able to do that successfully.  However, there is another text control txtSpecialTests that will affect the number of bottles required.  Basically, if there any special tests in the txtSpecialTests control, I want to add 1 to the value in column 4 of the combo box.  If txtSpecial tests is empty or null, I don't want to add 1.

I have the following code in the AfterUpdate event of the combo box:
Private Sub cboSelectedGridID_AfterUpdate()
    Select Case Me.txtSpecialTests
        Case IsNull(Me.txtSpecialTests)
            Me.txtBottlesRequired = Me.cboSelectedGridID.Column(3)
        Case Me.txtSpecialTests = ""
            Me.txtBottlesRequired = Me.cboSelectedGridID.Column(3)
        Case Else
            Me.txtBottlesRequired = Me.cboSelectedGridID.Column(3) + 1
    End Select
       
End Sub

It adds 1 every time, no matter whether the txtSpecialTests control is empty, null or not.


__._,_.___

Posted by: david.pratt@outlook.com
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (10)

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.


.

__,_._,___

[MS_AccessPros] Limit Child Records to One per Parent Record

 

I want to limit a child to one record per parent record.

child records are added in a subform with the main form based on the parent record. 

Can I place some code in the OnCurrent event of the subform that will prevent the creation of more than one child record per parent?


__._,_.___

Posted by: david.pratt@outlook.com
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (1)

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.


.

__,_._,___

Re: [MS_AccessPros] Input Mask

 

Thanks.
Next time when it doesn't work, I will immediately try the brackets and see what happens before I assume I am following the wrong path.


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

SortOrder might be a reserved word. Some interfaces will always require the brackets and might default to placing quotes around the names. 



From: MS_Access_Professionals@yahoogroups.com <MS_Access_Professionals@yahoogroups.com> on behalf of david.pratt@... [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com>
Sent: Saturday, December 31, 2016 3:46:23 PM
To: MS_Access_Professionals@yahoogroups.com
Subject: Re: [MS_AccessPros] Input Mask
 


There are no spaces.  The field name is SortOrder.
Perhaps I had inadvertently done something else wrong, but there were no spaces.


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

That's  just one of the reasons why most of us veteran developers don't use spaces in field names or use reserved words.


Duane




From: MS_Access_Professionals@yahoogroups.com <MS_Access_Professionals@yahoogroups.com> on behalf of david.pratt@... [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com>
Sent: Saturday, December 31, 2016 11:23 AM
To: MS_Access_Professionals@yahoogroups.com
Subject: Re: [MS_AccessPros] Input Mask
 


Thanks,
I had tried that but did not include the brackets around the field name.  It works now.



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

David-

Validation Rule:  Left([myfield], 1) IN ("B", "C", "E", "W", "X")

Validation Text: The first character must be B, C, E, W, or X.

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 
http://www.viescas.com/
www.viescas.com
Welcome to the home of John Viescas Consulting. If you're at all interested in Microsoft Access or SQL Server, this is the place to be! Check out the book ...

 
(Paris, France)




On Dec 31, 2016, at 6:02 PM, david.pratt@... [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:



I have an input mask, L000.  I want to have a validation rule that specifies that the Letter must be either B, C, E, W or X.  How can I put that in the validation rule?









__._,_.___

Posted by: david.pratt@outlook.com
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (7)

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.


.

__,_._,___

Re: [MS_AccessPros] Input Mask

 

SortOrder might be a reserved word. Some interfaces will always require the brackets and might default to placing quotes around the names. 



From: MS_Access_Professionals@yahoogroups.com <MS_Access_Professionals@yahoogroups.com> on behalf of david.pratt@outlook.com [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com>
Sent: Saturday, December 31, 2016 3:46:23 PM
To: MS_Access_Professionals@yahoogroups.com
Subject: Re: [MS_AccessPros] Input Mask
 


There are no spaces.  The field name is SortOrder.
Perhaps I had inadvertently done something else wrong, but there were no spaces.


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

That's  just one of the reasons why most of us veteran developers don't use spaces in field names or use reserved words.


Duane




From: MS_Access_Professionals@yahoogroups.com <MS_Access_Professionals@yahoogroups.com> on behalf of david.pratt@... [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com>
Sent: Saturday, December 31, 2016 11:23 AM
To: MS_Access_Professionals@yahoogroups.com
Subject: Re: [MS_AccessPros] Input Mask
 


Thanks,
I had tried that but did not include the brackets around the field name.  It works now.



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

David-

Validation Rule:  Left([myfield], 1) IN ("B", "C", "E", "W", "X")

Validation Text: The first character must be B, C, E, W, or X.

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 
http://www.viescas.com/
www.viescas.com
Welcome to the home of John Viescas Consulting. If you’re at all interested in Microsoft Access or SQL Server, this is the place to be! Check out the book ...

 
(Paris, France)




On Dec 31, 2016, at 6:02 PM, david.pratt@... [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:



I have an input mask, L000.  I want to have a validation rule that specifies that the Letter must be either B, C, E, W or X.  How can I put that in the validation rule?









__._,_.___

Posted by: Duane Hookom <duanehookom@hotmail.com>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (6)

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.


.

__,_._,___

Re: [MS_AccessPros] Input Mask

 

There are no spaces.  The field name is SortOrder.
Perhaps I had inadvertently done something else wrong, but there were no spaces.


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

That's  just one of the reasons why most of us veteran developers don't use spaces in field names or use reserved words.


Duane




From: MS_Access_Professionals@yahoogroups.com <MS_Access_Professionals@yahoogroups.com> on behalf of david.pratt@... [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com>
Sent: Saturday, December 31, 2016 11:23 AM
To: MS_Access_Professionals@yahoogroups.com
Subject: Re: [MS_AccessPros] Input Mask
 


Thanks,
I had tried that but did not include the brackets around the field name.  It works now.



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

David-

Validation Rule:  Left([myfield], 1) IN ("B", "C", "E", "W", "X")

Validation Text: The first character must be B, C, E, W, or X.

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 
http://www.viescas.com/
www.viescas.com
Welcome to the home of John Viescas Consulting. If you're at all interested in Microsoft Access or SQL Server, this is the place to be! Check out the book ...

 
(Paris, France)




On Dec 31, 2016, at 6:02 PM, david.pratt@... [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:



I have an input mask, L000.  I want to have a validation rule that specifies that the Letter must be either B, C, E, W or X.  How can I put that in the validation rule?







__._,_.___

Posted by: david.pratt@outlook.com
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (5)

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.


.

__,_._,___

Re: [MS_AccessPros] Input Mask

 

That's  just one of the reasons why most of us veteran developers don't use spaces in field names or use reserved words.


Duane




From: MS_Access_Professionals@yahoogroups.com <MS_Access_Professionals@yahoogroups.com> on behalf of david.pratt@outlook.com [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com>
Sent: Saturday, December 31, 2016 11:23 AM
To: MS_Access_Professionals@yahoogroups.com
Subject: Re: [MS_AccessPros] Input Mask
 


Thanks,
I had tried that but did not include the brackets around the field name.  It works now.



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

David-

Validation Rule:  Left([myfield], 1) IN ("B", "C", "E", "W", "X")

Validation Text: The first character must be B, C, E, W, or X.

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 
http://www.viescas.com/
www.viescas.com
Welcome to the home of John Viescas Consulting. If you’re at all interested in Microsoft Access or SQL Server, this is the place to be! Check out the book ...

 
(Paris, France)




On Dec 31, 2016, at 6:02 PM, david.pratt@... [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:



I have an input mask, L000.  I want to have a validation rule that specifies that the Letter must be either B, C, E, W or X.  How can I put that in the validation rule?







__._,_.___

Posted by: Duane Hookom <duanehookom@hotmail.com>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (4)

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.


.

__,_._,___

Re: [MS_AccessPros] Default Value

 

David-


Use a form and subform with two separate queries.  Set the Link properties of the subform, and Access will fill in the link value for you.

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 31, 2016, at 7:55 PM, david.pratt@outlook.com [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:



I have a form based on a 2 table parent-child query.  The parent table has a field named EqSort and the child has a field SPSort.  I want the default value of the SPSort field to equal [EqSort].  Both fields are in the query.  When I place =[EqSort] into the default property for SPSort it isn't working.  No error, it just does not add the default value.





__._,_.___

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.


.

__,_._,___

[MS_AccessPros] Default Value

 

I have a form based on a 2 table parent-child query.  The parent table has a field named EqSort and the child has a field SPSort.  I want the default value of the SPSort field to equal [EqSort].  Both fields are in the query.  When I place =[EqSort] into the default property for SPSort it isn't working.  No error, it just does not add the default value.


__._,_.___

Posted by: david.pratt@outlook.com
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (8)

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.


.

__,_._,___