![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Sorry to bug the list so much, I've got one last issue I can't work out, and my brain is fried (by the time this is done, my queries will likely be pulling over 12,000,000 records and I'm on brain drain mode right now). I've finally got all three combo boxes in my last post synchronized (long story short: I'm using three combo boxes to drill down deeper and deeper through a SQL query joining three tables, successively going down through Server Name, then Share Name, then the individual user - resulting in a text box populated with that user's access rights to that share on that server). My problem now is that when I select an entry on the last combo box (user name), and the After Update event procedure is triggered, I get the following error: Run-time error '2115': The macro or function set to the BeforeUpdate or ValidationRule property for this field is preventing Microsoft Office Access from saving the data in the field. There are no BeforeUpdate conditions or ValidationRule conditions set on any of my controls, so I'm not sure why it's throwing this. Here's the event procedure I'm doing on the final combo box After Update: Private Sub cmbTrusteeUser_AfterUpdate() Me.txtPermissions.SetFocus Me.txtPermissions.Text = "SELECT Access FROM" & _ " tblSharePermissions WHERE Server_Name = """ & _ Me.cmbServerName & _ """ AND Share_Name = """ & _ Me.cmbShareName & _ """ AND TrusteeDomain_Name = """ & _ Me.cmbTrusteeUser End Sub *I noted the mismatch in naming conventions between the table column TrusteeDomain_Name and my cmbTrusteeUser, it's on my list of things to remediate but I don't think it's causing the error. Could this be something in the formatting of the fields in the database tables? The field TrusteeDomain_Name has a slash in it (for example, "MICROSOFT\BGates001", without quotes). I've tried changing the assignment to Me.txtPermissions.Value , but then it just puts my query statement in there. Thanks |
#3
| |||
| |||
|
|
If you want the *result* of the query to appear in txtPermissions, rather than the SQL statement, then you are going about it the wrong way. Simplest approach is this: *txtPermissions = Dlookup( _ * * * * * * * * * * * * * * * * * * * * "Access", _ * * * * * * * * * * * * * * * * * * * * " tblSharePermissions", _ * * * * * * * * * * * * * * * * * * * * "Server_Name = """ & _ * * * * * * * * * * * * * * * * * * * * * * * * Me.cmbServerName & _ * * * * * * * * * * * * * * * * * * * * * * * * """ AND Share_Name = """ & _ * * * * * * * * * * * * * * * * * * * * * * * * Me.cmbShareName & _ * * * * * * * * * * * * * * * * * * * * * * * * """ AND TrusteeDomain_Name = """ & _ * * * * * * * * * * * * * * * * * * * * * * * * Me.cmbTrusteeUser) n.b. it's rarely necessary to use the Text property of a text box because, as you have obviously discovered, you are forced to give it the focus first. You can simply assign a value as I have shown above. "chickenfriedsteak" <ow... (AT) chickenfriedsteak (DOT) us> wrote in message news:a03ee7a0-e529-4e4f-9bd2-6d9096a41079 (AT) b16g2000yqb (DOT) googlegroups.com... Sorry to bug the list so much, I've got one last issue I can't work out, and my brain is fried (by the time this is done, my queries will likely be pulling over 12,000,000 records and I'm on brain drain mode right now). I've finally got all three combo boxes in my last post synchronized (long story short: I'm using three combo boxes to drill down deeper and deeper through a SQL query joining three tables, successively going down through Server Name, then Share Name, then the individual user - resulting in a text box populated with that user's access rights to that share on that server). *My problem now is that when I select an entry on the last combo box (user name), and the After Update event procedure is triggered, I get the following error: Run-time error '2115': The macro or function set to the BeforeUpdate or ValidationRule property for this field is preventing Microsoft Office Access from saving the data in the field. There are no BeforeUpdate conditions or ValidationRule conditions set on any of my controls, so I'm not sure why it's throwing this. *Here's the event procedure I'm doing on the final combo box After Update: Private Sub cmbTrusteeUser_AfterUpdate() * *Me.txtPermissions.SetFocus * *Me.txtPermissions.Text = "SELECT Access FROM" & _ * * * * * * * * * * * * * * * " tblSharePermissions WHERE Server_Name = """ & _ * * * * * * * * * * * * * * * Me.cmbServerName & _ * * * * * * * * * * * * * * * """ AND Share_Name = """ & _ * * * * * * * * * * * * * * * Me.cmbShareName & _ * * * * * * * * * * * * * * * """ AND TrusteeDomain_Name = """ & _ * * * * * * * * * * * * * * * Me.cmbTrusteeUser End Sub *I noted the mismatch in naming conventions between the table column TrusteeDomain_Name and my cmbTrusteeUser, it's on my list of things to remediate but I don't think it's causing the error. Could this be something in the formatting of the fields in the database tables? *The field TrusteeDomain_Name has a slash in it (for example, "MICROSOFT\BGates001", without quotes). *I've tried changing the assignment to Me.txtPermissions.Value , but then it just puts my query statement in there. Thanks- Hide quoted text - - Show quoted text - |
#4
| |||
| |||
|
#5
| |||
| |||
|
|
"chickenfriedsteak" <ow... (AT) chickenfriedsteak (DOT) us> wrote in message news:f0145f3d-92ba-4260-8aac-1e1ec9a9a627 (AT) v15g2000yqn (DOT) googlegroups.com... On Mar 18, 2:06 pm, "bcap" <b... (AT) nospam (DOT) nowhere> wrote: If you carefully compare what you've implemented to what I *posted, youwill see that you've added extra ampersands (&) where you don't need them. The ampersand is not part of a line continuation. *The underscore character alone implements a line continuation. *The ampersand is the string concatenation operator. |
#6
| |||
| |||
|
|
"chickenfriedsteak" <ow... (AT) chickenfriedsteak (DOT) us> wrote in message news:f0145f3d-92ba-4260-8aac-1e1ec9a9a627 (AT) v15g2000yqn (DOT) googlegroups.com... On Mar 18, 2:06 pm, "bcap" <b... (AT) nospam (DOT) nowhere> wrote: If you carefully compare what you've implemented to what I posted, you will see that you've added extra ampersands (&) where you don't need them. The ampersand is not part of a line continuation. The underscore character alone implements a line continuation. The ampersand is the string concatenation operator. |
#7
| |||
| |||
|
|
One of us has omitted the closing quotation marks on the last line, which should read as follows: Me.Combo17 & """") n.b. yes, that really is *four* double-quote marks! (Snip) |
#8
| |||
| |||
|
|
On Mar 18, 3:43*pm, "bcap" <b... (AT) nospam (DOT) nowhere> wrote:> One of us has omitted the closing quotation marks on the last line, which should read as follows: Me.Combo17 & """") n.b. yes, that really is *four* double-quote marks! (Snip) YARGGHHH! *that fixed it. I haven't done this much hassling and cussing at quotation marks since the last time I had to touch something in C++. |
#9
| |||
| |||
|
|
One of us has omitted the closing quotation marks on the last line, which should read as follows: Me.Combo17 & """") n.b. yes, that really is *four* double-quote marks! (Snip) |
|
YARGGHHH! that fixed it. I haven't done this much hassling and cussing at quotation marks since the last time I had to touch something in C++. |
#10
| |||
| |||
|
|
On Mar 18, 3:43 pm, "bcap" <b... (AT) nospam (DOT) nowhere> wrote:> One of us has omitted the closing quotation marks on the last line, which should read as follows: Me.Combo17 & """") n.b. yes, that really is *four* double-quote marks! (Snip) YARGGHHH! that fixed it. I haven't done this much hassling and cussing at quotation marks since the last time I had to touch something in C++. |
![]() |
| Thread Tools | |
| Display Modes | |
| |