Selasa, 22 Desember 2020

Re: [MSAccessProfessionals] UPDATE TABLE issue

Thanks Again.

On Tuesday, December 22, 2020, 03:35:30 PM CST, Paul Baldy <pbaldy@gmail.com> wrote:


Happy to help Sean!  JasonM has a FAQ on the subject here:


Paul

------ Original Message ------
From: "Sean Cooper via groups.io" <smcjb=yahoo.com@groups.io>
Sent: 12/22/2020 11:44:15 AM
Subject: Re: [MSAccessProfessionals] UPDATE TABLE issue

Thanks Paul. That fixes it. Is there an easy explanation as to why it needed the ' deliminaters?


On Tuesday, December 22, 2020, 01:32:06 PM CST, Paul Baldy <pbaldy@gmail.com> wrote:


The value needs delimiters.  Try

CurrentDb.Execute "UPDATE " & TableToModify & " SET " & NewColName & " = '" & myString & "'"

Paul

------ Original Message ------
From: "Sean Cooper via groups.io" <smcjb=yahoo.com@groups.io>
Sent: 12/22/2020 11:17:14 AM
Subject: [MSAccessProfessionals] UPDATE TABLE issue

The following works fine

Public Sub MyAddColumn()

Dim TableToModify As String
Dim NewColName As String
Dim mylong As Long

TableToModify = "ABC"
NewColName = "NewCol20"
mylong = 1122

CurrentDb.Execute "ALTER TABLE " & TableToModify & " ADD COLUMN " & NewColName & " Long"
CurrentDb.Execute "UPDATE " & TableToModify & " SET " & NewColName & " = " & mylong

End Sub

But when I try and modify it to update with a string or text instead of a Long I get a Run-Time error 3061, Too few parameters. Expected 1. I've tried changing the ALTER TABLE to CHAR(14), Dim'ing the String with no size all with no luck.

Public Sub MyAddColumn()

Dim TableToModify As String
Dim NewColName As String
Dim myString As String * 14

TableToModify = "ABC"
NewColName = "NewCol20"
myString = "ABCD1234567890

CurrentDb.Execute "ALTER TABLE " & TableToModify & " ADD COLUMN " & NewColName & " TEXT(14)"
CurrentDb.Execute "UPDATE " & TableToModify & " SET " & NewColName & " = " & myString

End Sub

Any help appreciated.

Thanks

Sean

Re: [MSAccessProfessionals] UPDATE TABLE issue

Happy to help Sean!  JasonM has a FAQ on the subject here:


Paul

------ Original Message ------
From: "Sean Cooper via groups.io" <smcjb=yahoo.com@groups.io>
Sent: 12/22/2020 11:44:15 AM
Subject: Re: [MSAccessProfessionals] UPDATE TABLE issue

Thanks Paul. That fixes it. Is there an easy explanation as to why it needed the ' deliminaters?


On Tuesday, December 22, 2020, 01:32:06 PM CST, Paul Baldy <pbaldy@gmail.com> wrote:


The value needs delimiters.  Try

CurrentDb.Execute "UPDATE " & TableToModify & " SET " & NewColName & " = '" & myString & "'"

Paul

------ Original Message ------
From: "Sean Cooper via groups.io" <smcjb=yahoo.com@groups.io>
Sent: 12/22/2020 11:17:14 AM
Subject: [MSAccessProfessionals] UPDATE TABLE issue

The following works fine

Public Sub MyAddColumn()

Dim TableToModify As String
Dim NewColName As String
Dim mylong As Long

TableToModify = "ABC"
NewColName = "NewCol20"
mylong = 1122

CurrentDb.Execute "ALTER TABLE " & TableToModify & " ADD COLUMN " & NewColName & " Long"
CurrentDb.Execute "UPDATE " & TableToModify & " SET " & NewColName & " = " & mylong

End Sub

But when I try and modify it to update with a string or text instead of a Long I get a Run-Time error 3061, Too few parameters. Expected 1. I've tried changing the ALTER TABLE to CHAR(14), Dim'ing the String with no size all with no luck.

Public Sub MyAddColumn()

Dim TableToModify As String
Dim NewColName As String
Dim myString As String * 14

TableToModify = "ABC"
NewColName = "NewCol20"
myString = "ABCD1234567890

CurrentDb.Execute "ALTER TABLE " & TableToModify & " ADD COLUMN " & NewColName & " TEXT(14)"
CurrentDb.Execute "UPDATE " & TableToModify & " SET " & NewColName & " = " & myString

End Sub

Any help appreciated.

Thanks

Sean

Re: [MSAccessProfessionals] UPDATE TABLE issue

Thanks Paul. That fixes it. Is there an easy explanation as to why it needed the ' deliminaters?


On Tuesday, December 22, 2020, 01:32:06 PM CST, Paul Baldy <pbaldy@gmail.com> wrote:


The value needs delimiters.  Try

CurrentDb.Execute "UPDATE " & TableToModify & " SET " & NewColName & " = '" & myString & "'"

Paul

------ Original Message ------
From: "Sean Cooper via groups.io" <smcjb=yahoo.com@groups.io>
Sent: 12/22/2020 11:17:14 AM
Subject: [MSAccessProfessionals] UPDATE TABLE issue

The following works fine

Public Sub MyAddColumn()

Dim TableToModify As String
Dim NewColName As String
Dim mylong As Long

TableToModify = "ABC"
NewColName = "NewCol20"
mylong = 1122

CurrentDb.Execute "ALTER TABLE " & TableToModify & " ADD COLUMN " & NewColName & " Long"
CurrentDb.Execute "UPDATE " & TableToModify & " SET " & NewColName & " = " & mylong

End Sub

But when I try and modify it to update with a string or text instead of a Long I get a Run-Time error 3061, Too few parameters. Expected 1. I've tried changing the ALTER TABLE to CHAR(14), Dim'ing the String with no size all with no luck.

Public Sub MyAddColumn()

Dim TableToModify As String
Dim NewColName As String
Dim myString As String * 14

TableToModify = "ABC"
NewColName = "NewCol20"
myString = "ABCD1234567890

CurrentDb.Execute "ALTER TABLE " & TableToModify & " ADD COLUMN " & NewColName & " TEXT(14)"
CurrentDb.Execute "UPDATE " & TableToModify & " SET " & NewColName & " = " & myString

End Sub

Any help appreciated.

Thanks

Sean

Re: [MSAccessProfessionals] UPDATE TABLE issue

The value needs delimiters.  Try

CurrentDb.Execute "UPDATE " & TableToModify & " SET " & NewColName & " = '" & myString & "'"

Paul

------ Original Message ------
From: "Sean Cooper via groups.io" <smcjb=yahoo.com@groups.io>
Sent: 12/22/2020 11:17:14 AM
Subject: [MSAccessProfessionals] UPDATE TABLE issue

The following works fine

Public Sub MyAddColumn()

Dim TableToModify As String
Dim NewColName As String
Dim mylong As Long

TableToModify = "ABC"
NewColName = "NewCol20"
mylong = 1122

CurrentDb.Execute "ALTER TABLE " & TableToModify & " ADD COLUMN " & NewColName & " Long"
CurrentDb.Execute "UPDATE " & TableToModify & " SET " & NewColName & " = " & mylong

End Sub

But when I try and modify it to update with a string or text instead of a Long I get a Run-Time error 3061, Too few parameters. Expected 1. I've tried changing the ALTER TABLE to CHAR(14), Dim'ing the String with no size all with no luck.

Public Sub MyAddColumn()

Dim TableToModify As String
Dim NewColName As String
Dim myString As String * 14

TableToModify = "ABC"
NewColName = "NewCol20"
myString = "ABCD1234567890

CurrentDb.Execute "ALTER TABLE " & TableToModify & " ADD COLUMN " & NewColName & " TEXT(14)"
CurrentDb.Execute "UPDATE " & TableToModify & " SET " & NewColName & " = " & myString

End Sub

Any help appreciated.

Thanks

Sean

[MSAccessProfessionals] UPDATE TABLE issue

The following works fine

Public Sub MyAddColumn()

Dim TableToModify As String
Dim NewColName As String
Dim mylong As Long

TableToModify = "ABC"
NewColName = "NewCol20"
mylong = 1122

CurrentDb.Execute "ALTER TABLE " & TableToModify & " ADD COLUMN " & NewColName & " Long"
CurrentDb.Execute "UPDATE " & TableToModify & " SET " & NewColName & " = " & mylong

End Sub

But when I try and modify it to update with a string or text instead of a Long I get a Run-Time error 3061, Too few parameters. Expected 1. I've tried changing the ALTER TABLE to CHAR(14), Dim'ing the String with no size all with no luck.

Public Sub MyAddColumn()

Dim TableToModify As String
Dim NewColName As String
Dim myString As String * 14

TableToModify = "ABC"
NewColName = "NewCol20"
myString = "ABCD1234567890

CurrentDb.Execute "ALTER TABLE " & TableToModify & " ADD COLUMN " & NewColName & " TEXT(14)"
CurrentDb.Execute "UPDATE " & TableToModify & " SET " & NewColName & " = " & myString

End Sub

Any help appreciated.

Thanks

Sean

Minggu, 20 Desember 2020

Re: [MSAccessProfessionals] Custom Ribbon not showing

can you use ActivateTab.
gobjRibbon.ActivateTab "idOfMyTab".


On Sat, Dec 19, 2020 at 10:00 AM Bill Mosca <wrmosca@myself.com> wrote:
Hi Crystal

Sendkeys would really have to be a last resort. They are so unreliable. I sent out instructions to all my users. Maybe that will be good enough until I stumble upon a solution.

On Sat, Dec 19, 2020 at 07:04 AM, crystal (strive4peace) wrote:

hi Bill !

I'm no ribbon expert, but SendKeys is always a last resort, if your custom ribbon has a hotkey

kind regards,
crystal

 

On 12/18/2020 5:40 PM, Bill Mosca wrote:
On Fri, Dec 18, 2020 at 09:39 AM, Bill Mosca wrote:
Arnelito - Thank you for taking the time to send me a sample. After turning on the "Show add-in user interface errors" (which I thought I already turned on), I found I had some syntax errors in my XML. I'll work on those and see if that fixes my issue.

Again, thanks for taking the time to help.
--
Regards,
Bill Mosca, Founder - MS_Access_Professionals
Microsoft Office Access MVP 2010-2016
My nothing-to-do-with-Access blog
 
I got it all working. One last little tweak. The custom report ribbon loads but the Home tab still has the focus. Does anyone know how to use a command to put the focus on the custom tab? It would be best that the user sees it when thte report opens in Preview.
 
--
Regards,
Bill Mosca, Founder - MS_Access_Professionals
Microsoft Office Access MVP 2010-2016
My nothing-to-do-with-Access blog
 

 
--
Regards,
Bill Mosca, Founder - MS_Access_Professionals
Microsoft Office Access MVP 2010-2016
My nothing-to-do-with-Access blog
 



--
Arnelito G. Puzon


_._,_._,_

Groups.io Links:

You receive all messages sent to this group.

View/Reply Online (#115825) | Reply To Group | Reply To Sender | Mute This Topic | New Topic
Your Subscription | Contact Group Owner | Unsubscribe [sugeng.panjalu.access@blogger.com]

_._,_._,_

Sabtu, 19 Desember 2020

Re: [MSAccessProfessionals] Custom Ribbon not showing

Hi Crystal

Sendkeys would really have to be a last resort. They are so unreliable. I sent out instructions to all my users. Maybe that will be good enough until I stumble upon a solution.

On Sat, Dec 19, 2020 at 07:04 AM, crystal (strive4peace) wrote:

hi Bill !

I'm no ribbon expert, but SendKeys is always a last resort, if your custom ribbon has a hotkey

kind regards,
crystal

 

On 12/18/2020 5:40 PM, Bill Mosca wrote:
On Fri, Dec 18, 2020 at 09:39 AM, Bill Mosca wrote:
Arnelito - Thank you for taking the time to send me a sample. After turning on the "Show add-in user interface errors" (which I thought I already turned on), I found I had some syntax errors in my XML. I'll work on those and see if that fixes my issue.

Again, thanks for taking the time to help.
--
Regards,
Bill Mosca, Founder - MS_Access_Professionals
Microsoft Office Access MVP 2010-2016
My nothing-to-do-with-Access blog
 
I got it all working. One last little tweak. The custom report ribbon loads but the Home tab still has the focus. Does anyone know how to use a command to put the focus on the custom tab? It would be best that the user sees it when thte report opens in Preview.
 
--
Regards,
Bill Mosca, Founder - MS_Access_Professionals
Microsoft Office Access MVP 2010-2016
My nothing-to-do-with-Access blog
 

 
--
Regards,
Bill Mosca, Founder - MS_Access_Professionals
Microsoft Office Access MVP 2010-2016
My nothing-to-do-with-Access blog
 
_._,_._,_

Groups.io Links:

You receive all messages sent to this group.

View/Reply Online (#115824) | Reply To Group | Reply To Sender | Mute This Topic | New Topic
Your Subscription | Contact Group Owner | Unsubscribe [sugeng.panjalu.access@blogger.com]

_._,_._,_