Minggu, 26 Mei 2019

Re: [MS_AccessPros] Record count for INSERT INTO, UPDATE

 

hi Steve,

adding on to Duane's comment ...

dim nNumberRecords as long _
,sSQL as string

sSQL = "blah blah"

with me.currentdb
?.execute sSQL
?nNumberRecords = .RecordCount
end with

~crystal

On 5/26/2019 1:48 PM, Duane Hookom duanehookom@hotmail.com [MS_Access_Professionals] wrote:

Consider using .Execute in place of the DoCmd. This exposes the RecordsAffected property.

Duane



On May 26, 2019, at 1:04 PM, "Steve thaw5 thaw5@suddenlink.net [MS_Access_Professionals]" <MS_Access_Professionals@yahoogroups.com> wrote:

I am using DoCmd.RunSQL with INSERT INTO and UPDATE action queries. Is
there a way to get the number of records inserted or updated for use in?
a debug.print statement?

Thanks.

Steve


------------------------------------
Posted by: Steve thaw5 <thaw5@suddenlink.net>
------------------------------------


------------------------------------

Yahoo Groups Links

<*> To visit your group on the web, go to:
??? http://groups.yahoo.com/group/MS_Access_Professionals/

<*> Your email settings:
??? Individual Email | Traditional

<*> To change settings online go to:
??? http://groups.yahoo.com/group/MS_Access_Professionals/join
??? (Yahoo! ID required)

<*> To change settings via email:
??? MS_Access_Professionals-digest@yahoogroups.com
??? MS_Access_Professionals-fullfeatured@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
??? MS_Access_Professionals-unsubscribe@yahoogroups.com

<*> Your use of Yahoo Groups is subject to:
??? https://info.yahoo.com/legal/us/yahoo/utos/terms/

__._,_.___

Posted by: crystal 8 <strive4peace2008@yahoo.com>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (3)

SPONSORED LINKS
.

__,_._,___

Re: [MS_AccessPros] Record count for INSERT INTO, UPDATE

 

Consider using .Execute in place of the DoCmd. This exposes the RecordsAffected property.

Duane



On May 26, 2019, at 1:04 PM, "Steve thaw5 thaw5@suddenlink.net [MS_Access_Professionals]" <MS_Access_Professionals@yahoogroups.com> wrote:

I am using DoCmd.RunSQL with INSERT INTO and UPDATE action queries. Is
there a way to get the number of records inserted or updated for use in 
a debug.print statement?

Thanks.

Steve


------------------------------------
Posted by: Steve thaw5 <thaw5@suddenlink.net>
------------------------------------


------------------------------------

Yahoo Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/MS_Access_Professionals/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/MS_Access_Professionals/join
    (Yahoo! ID required)

<*> To change settings via email:
    MS_Access_Professionals-digest@yahoogroups.com
    MS_Access_Professionals-fullfeatured@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
    MS_Access_Professionals-unsubscribe@yahoogroups.com

<*> Your use of Yahoo Groups is subject to:
    https://info.yahoo.com/legal/us/yahoo/utos/terms/

__._,_.___

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 (2)

SPONSORED LINKS
.

__,_._,___

[MS_AccessPros] Record count for INSERT INTO, UPDATE

 

I am using DoCmd.RunSQL with INSERT INTO and UPDATE action queries.. Is
there a way to get the number of records inserted or updated for use in 
a debug.print statement?

Thanks.

Steve

__._,_.___

Posted by: Steve thaw5 <thaw5@suddenlink.net>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (1)

SPONSORED LINKS
.

__,_._,___

Jumat, 24 Mei 2019

[MS_AccessPros] Re: Visible or not

 

Bill - Changing a property via code is only temporary. If the form is closed the change is dismissed. If you are storing the selection in a table you could use DLookup() during the form's Load event to recall that value and hide or expose the control just like you do in the AfterUpdate event.


If DLookup("myfield", "myTable", "WHERE contitionGoesHere") = 1 Then...

Shorter way to write your code:

Private Sub cboOtherCoverage_AfterUpdate()

Me.HelNameOfOtherCoverage.Visible = (cboOtherCoverage = 1)
 
End Sub

-Bill Moscfa


---In MS_Access_Professionals@yahoogroups.com, <Bill.Singer@at-group.net> wrote :

I have a combo box in which the user selects and options.  Depending on the option, additional fields show up on the form.  The combo box stores a value in a table, which is used later in a report.  The code is below. It works fine during the initial form completion.  However if I close the form and reopen it, the correct field do not show up.  Do I have to also put this code in the From "On Current Event"?   What if I have a few of these on one form, do I have to put code for all of them in the form "On Current" event?

 

Here is the code.

 

Private Sub cboOtherCoverage_AfterUpdate()

 

If cboOtherCoverage = 1 Then

Me.HelNameOfOtherCoverage.Visible = True

 

Else: Me.HelNameOfOtherCoverage.Visible = False

End If

 

End Sub

 

 

Bill

 

Bill Singer

Access 365

Minnesota

__._,_.___

Posted by: wrmosca@comcast.net
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (2)

SPONSORED LINKS
.

__,_._,___

Kamis, 23 Mei 2019

[MS_AccessPros] Visible or not

 

I have a combo box in which the user selects and options.  Depending on the option, additional fields show up on the form.  The combo box stores a value in a table, which is used later in a report.  The code is below. It works fine during the initial form completion.  However if I close the form and reopen it, the correct field do not show up.  Do I have to also put this code in the From “On Current Event”?   What if I have a few of these on one form, do I have to put code for all of them in the form “On Current” event?

 

Here is the code.

 

Private Sub cboOtherCoverage_AfterUpdate()

 

If cboOtherCoverage = 1 Then

Me.HelNameOfOtherCoverage.Visible = True

 

Else: Me.HelNameOfOtherCoverage.Visible = False

End If

 

End Sub

 

 

Bill

 

Bill Singer

Access 365

Minnesota

__._,_.___

Posted by: <bill.singer@at-group.net>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (1)

SPONSORED LINKS
.

__,_._,___

Selasa, 21 Mei 2019

Re: [MS_AccessPros] help with query

 


Duane,

You are right , but its not my data to change.
What you showed is so helpful.
Exactly what I need.
Thanks
Sarah

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

Sarah,
Your data needs to be normalized. Each combination of diet and ID should create a record in a junction table. You can get there by creating a union query.

Select ID, 1 as Num, Diet1 as Diet
From [ your table]
Union all
Select ID, 2, Diet2
From [ your table]
Where Diet2 is not null
Union all
Select ID, 3, Diet3
From [ your table]
Where Diet3 is not null
Union all
Select ID, 4, Diet4
From [ your table]
Where Diet4 is not null;

You can now create a totals query based on the union query.I

I would change the table structure of it was my application.

Duane



On May 21, 2019, at 8:22 AM, "sarahk@... [MS_Access_Professionals]" <MS_Access_Professionals@yahoogroups.com> wrote:



I have a query with participants name and up to 4 special diets for each: ID, diet1, diet2, diet3, diet4.

I need to count the total numbers for each diet. I think I would need to use TRANSFORM COUNT(diet1) etc, but since it is 4 separate columns I am not sure how to do this  and how to GROUP it so that I get only one column:

eg :NOSUGAR total nn

NOSALT total nn

the total would be  based on all 4 columns combined.


All help is greatly appreciated.


Sarah





__._,_.___

Posted by: sarahk@schemesoftware.com
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (19)

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.


SPONSORED LINKS
.

__,_._,___