Go Back   Access World Forums > Microsoft Access Discussion > General

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 05-15-2019, 09:49 AM   #16
The_Doc_Man
Happy Retired Curmudgeon
 
Join Date: Feb 2001
Location: Suburban New Orleans, LA, USA
Posts: 13,527
Thanks: 73
Thanked 1,474 Times in 1,363 Posts
The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold
Re: Run-time Syntax Error

essaytee's comment triggered a memory. When you rip out stuff from the form and try to rebuild it, you can have "remnant" code in the class module. The events you programmed into the sub-form's controls got ripped out when you removed that form for the do-over. But that action didn't take the code with it when you did the rip-out because that code was in the separate class module.

It is therefore possible for you to have the double-click event code sitting there left over from the prior iteration but disconnected from everything. If you go into the property sheet and select that you will use an event procedure (as shown by essaytee), the dangling code suddenly recognizes that it is part of an event procedure and reconnects to the entry point. After that, it goes "live" again. Also watch out because if you have the event property sheet open and double-click that event slot, it might try to create a second entry point, which gets really crazy because VBA lets that happen. In essence, whichever one appeared SECOND in the class module is used because the second entry point supersedes the first one. Crazy, eh? But somehow it does.

As to your other question, I do not take databases from other persons. It is a personal preference and represents a precedent I don't wish to set. I don't mind helping and will try hard to think about issues, but I don't work with someone else's code unless I have to. And since I'm retired now, I no longer have to. It is not anything personal about you and please don't take it that way.

__________________
I'm a certified grandpa (3 times now) and proud of it.
Retired over one year and survived being home all day with the wife. She must really love me.
If I have helped you, please either click the thanks or click the scales.
The_Doc_Man is offline   Reply With Quote
Old 05-15-2019, 05:05 PM   #17
Aimn_4U
Newly Registered User
 
Join Date: May 2019
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Aimn_4U is on a distinguished road
Re: Run-time Syntax Error

Hi Essay_Tee & The_Doc_Man,

Thank you both for your assistance.
I definitely have the event procedure attached to the relevant textbox control. Please see screen shot attached.
I believe I also have the correct code against it, and cannot see that there is any other code sitting in the “background”. I have attached a screenshot of this also.
Is there something I am missing or is it possibly a property control that I do not have set up correctly ?
Attached Images
File Type: png Dbl Click Event Procedure.PNG (48.1 KB, 10 views)
File Type: png Dbl Click Code.PNG (34.8 KB, 10 views)
Aimn_4U is offline   Reply With Quote
Old 05-15-2019, 07:00 PM   #18
essaytee
Need a good one-liner.
 
essaytee's Avatar
 
Join Date: Oct 2008
Location: Melbourne, Australia
Posts: 512
Thanks: 9
Thanked 123 Times in 119 Posts
essaytee is on a distinguished road
Re: Run-time Syntax Error

Something to try and without any other changes the result should be the same. Run the subform directly (not as a subform). Does the double-click event work? On the same subform, create another textbox control, add a double-click event, code a simple message or a debug.print statement, just to see if it works.

__________________
Steve.

I know UNIX, PASCAL, C, FORTRAN, COBOL, and nineteen other high-tech words.
essaytee is online now   Reply With Quote
Old 05-15-2019, 07:11 PM   #19
JHB
Have been here a while
 
Join Date: Jun 2012
Location: In the south of Denmark (Jutland), near the German border.
Posts: 7,619
Thanks: 2
Thanked 2,044 Times in 1,999 Posts
JHB has a spectacular aura about JHB has a spectacular aura about
Re: Run-time Syntax Error

Post your database with some sample data, zip it because you haven't post 10 post yet.
__________________
If the above post has helped you, why not take the time to say thank you, by pressing the "Thumbs up."
JHB is offline   Reply With Quote
Old 05-15-2019, 07:54 PM   #20
Aimn_4U
Newly Registered User
 
Join Date: May 2019
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Aimn_4U is on a distinguished road
Re: Run-time Syntax Error

Hi JHB,

Please find attached a copy of my database with dummy data. I still can not figure out why it is not opening.

Essay_Tee - Excuse my ignorance, I typed in the Debug.Print Statement - what is this supposed to do ?

thank you everyone for your help.
Attached Files
File Type: zip Practise Database - 14-05-19 2220000000000000000000.zip (185.1 KB, 7 views)
Aimn_4U is offline   Reply With Quote
Old 05-15-2019, 08:22 PM   #21
essaytee
Need a good one-liner.
 
essaytee's Avatar
 
Join Date: Oct 2008
Location: Melbourne, Australia
Posts: 512
Thanks: 9
Thanked 123 Times in 119 Posts
essaytee is on a distinguished road
Re: Run-time Syntax Error

Quote:
Originally Posted by Aimn_4U View Post
Hi JHB,

Please find attached a copy of my database with dummy data. I still can not figure out why it is not opening.

Essay_Tee - Excuse my ignorance, I typed in the Debug.Print Statement - what is this supposed to do ?

thank you everyone for your help.

Code:
Debug.Print "Show this message"
Will merely print, "Show this message" in the immediate window. It is a very useful tool when trying to debug code. Debug.print strMsg will display whatever strMsg holds.


Can't check your db at the moment, still at work, will check later.
__________________
Steve.

I know UNIX, PASCAL, C, FORTRAN, COBOL, and nineteen other high-tech words.
essaytee is online now   Reply With Quote
Old 05-15-2019, 08:59 PM   #22
JHB
Have been here a while
 
Join Date: Jun 2012
Location: In the south of Denmark (Jutland), near the German border.
Posts: 7,619
Thanks: 2
Thanked 2,044 Times in 1,999 Posts
JHB has a spectacular aura about JHB has a spectacular aura about
Re: Run-time Syntax Error

Don't know why you say it doesn't work, by me it does!
Attached Images
File Type: jpg Doubleclick.jpg (60.3 KB, 52 views)

__________________
If the above post has helped you, why not take the time to say thank you, by pressing the "Thumbs up."
JHB is offline   Reply With Quote
Old 05-15-2019, 10:17 PM   #23
Aimn_4U
Newly Registered User
 
Join Date: May 2019
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Aimn_4U is on a distinguished road
Re: Run-time Syntax Error

Hi JHB,
Thank you so much for your assistance. You are not going to believe what was stopping mine from opening.
At work we have Laptop docks and then 2 screens attached. IT let us know that when we press shutdown the laptop only goes to sleep. At the advise from a lady from work after reading your post above, she told me to do a full restart on my computer and HALLELUJAH ! It worked.
I absolutely cannot believe it.
Aimn_4U is offline   Reply With Quote
Old 05-15-2019, 10:21 PM   #24
JHB
Have been here a while
 
Join Date: Jun 2012
Location: In the south of Denmark (Jutland), near the German border.
Posts: 7,619
Thanks: 2
Thanked 2,044 Times in 1,999 Posts
JHB has a spectacular aura about JHB has a spectacular aura about
Re: Run-time Syntax Error

:-) :-) :-)
__________________
If the above post has helped you, why not take the time to say thank you, by pressing the "Thumbs up."
JHB is offline   Reply With Quote
Old 05-16-2019, 05:17 AM   #25
The_Doc_Man
Happy Retired Curmudgeon
 
Join Date: Feb 2001
Location: Suburban New Orleans, LA, USA
Posts: 13,527
Thanks: 73
Thanked 1,474 Times in 1,363 Posts
The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold
Re: Run-time Syntax Error

Ah, the "ragged" sleep syndrome. This is a problem in the way your system's power-saver policy is defined. I've seen it before. Something about sleeping and then waking up again isn't quite right but I've never found the exact setting either.
__________________
I'm a certified grandpa (3 times now) and proud of it.
Retired over one year and survived being home all day with the wife. She must really love me.
If I have helped you, please either click the thanks or click the scales.
The_Doc_Man is offline   Reply With Quote
Old Yesterday, 06:01 PM   #26
Aimn_4U
Newly Registered User
 
Join Date: May 2019
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Aimn_4U is on a distinguished road
Re: Run-time Syntax Error

Thank you all so much for your Assistance.
I do have one other question to ask.
I have a combo box set up with a list in it and once the correct detail is selected it puts it into a text box. Is there a code that i can do so they are able to double click a detail, it adds it to the text box, and they can then select another one and it also adds this to the text box.
Essentially I would like them to be able select multiple options to add to the text box, which then saves this details into my table.

So far I have used:


Private Sub Course_Major_Stream_Code_Change()
Me.Specific_to_Curtin_Major_or_Course = Me.Course_Major_Stream_Code(1)
End Sub

This works but only allows for one option.

Thank you
Aimn_4U is offline   Reply With Quote
Old Yesterday, 10:01 PM   #27
The_Doc_Man
Happy Retired Curmudgeon
 
Join Date: Feb 2001
Location: Suburban New Orleans, LA, USA
Posts: 13,527
Thanks: 73
Thanked 1,474 Times in 1,363 Posts
The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold
Re: Run-time Syntax Error

OK, TWO comments:

First: If you are trying to build a string this way, you would add to a given text sequence using the "&" operator.

Code:
Me.TargetString = Me.TargetString & ", " & NewSourceItem
You would have to use the Form_Current event or some other event to erase the target string once you had used it and were done with it.

Second: Normally, if you are somehow associating some list of values with some individual entity, you don't concatenate strings. Instead, you create a child table that enumerates the individual strings using a foreign key in the list elements that points back to the course info.

__________________
I'm a certified grandpa (3 times now) and proud of it.
Retired over one year and survived being home all day with the wife. She must really love me.
If I have helped you, please either click the thanks or click the scales.
The_Doc_Man is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Syntax error (missing operator) in query expression - Run-time error 3075 Kobus.Worx Modules & VBA 5 05-06-2019 09:40 AM
Run time error '3075': Syntax error (missing operator) in query expression manusri Modules & VBA 9 02-16-2017 05:45 PM
Syntax error in Alter Table statement - Run-time error '3293': JGravesNBS Modules & VBA 4 10-24-2015 10:21 AM
Question strSQL = Run Time Error 3075 Syntax Error Missing Operator in qry Expr maxsun08 General 4 07-27-2012 06:39 AM
Run time error 3075 - syntax error (missing operator) in query expression puskardas Modules & VBA 8 06-30-2008 07:35 PM




All times are GMT -8. The time now is 04:59 AM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Featured Forum post


Sponsored Links


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World