query editor (1 Viewer)

Mile-O

Back once again...
Local time
Today, 14:27
Joined
Dec 10, 2002
Messages
11,316
I don't know the SQL - it's your table.

If you want the SQL of a query you've made then switch it from design view to SQL view and copy what's given.

Or you could just save the query and use it as the RowSource for the combo and forget about SQL altogether.
 

still_rookie

Registered User.
Local time
Today, 16:27
Joined
Apr 17, 2005
Messages
122
ok here's my database...

can you plz create an sql code for the table Car_Details ???

and tell me the code.. cuz i dunno how to do it ... plz ..

btw... itz not the sql code of a query i made that i want... i just want to open that table from a combo box, for which i need the sql code...

If you want the SQL of a query you've made
 

Attachments

  • MYPROJ.zip
    175.5 KB · Views: 92
Last edited:

Mile-O

Back once again...
Local time
Today, 14:27
Joined
Dec 10, 2002
Messages
11,316
still_rookie said:
itz not the sql code of a query i made that i want... i just want to open that table from a combo box, for which i need the sql code...

SQL does not do that. It selects records. You need VBA in the combo's AfterUpdate event and you've already been given that. Read peoples' responses - they are, actually, helpful.
 

still_rookie

Registered User.
Local time
Today, 16:27
Joined
Apr 17, 2005
Messages
122
no wait...

you didnt get me ...
ok take a look at this...

itz a SOLUTION to the qsn i asked in the general section... but SOME PPL were i guess to lazy to answer.. or ddnt know about it ...

so take a look at this:
First I would have a tblHistory table like this:

HistoryID (PK Autonumber)
CarID (Foreign key to cars table)
InOut
HistoryTime

So I would have ONE form with the Data Entry property set to Yes so the user can only enter records, not edit them. On that form have a combobox where the user selects the car and a button to save the record the button would initially have its Visible property set to No. I would also have two hidden textboxes that are bound to InOut and Historytime fields.

Now look at tha tpart where it says - On that form have a combobox where the user selects the car and a button to save the record the button would initially have

THATS why i need the sql code ... geddit ???
 

Mile-O

Back once again...
Local time
Today, 14:27
Joined
Dec 10, 2002
Messages
11,316
This is it - goodbye!

still_rookie said:
SOME PPL were i guess to lazy to answer

If you want to abuse people then do it elsewhere. Nobody is here to pander to you. And as such, you have been given lots of help but it appears you have not bothered to take anything on board and seem unwilling to use any initiative. As such, I hope you get your answer but I'm not going to bother wasting my time on you anymore. I don't even know what you are talking about most of the time, to be honest, because of continuing abbreviations.
 

still_rookie

Registered User.
Local time
Today, 16:27
Joined
Apr 17, 2005
Messages
122
the abusing wasn't sarted by me.. and if you check YOUR posts... you abuse most of the time... so litrally speaking ... you have to right to say If you want to abuse people then do it elsewhere.

This forum is a waste... people like you arejust not willing to give a little time and give a full description of the answer to the question.

If you want to help, help fully.. and dont answer in bits...

All you say is : Do this.

But the question is "HOW"???

We know we have to do this or do that.. but how do we do it is the question... BUT you just don't seem to get it.

Anyway, as unhappy as a footballer with his club, im calling it goodbye fot the last and final time.

for people as annoyed as me - check this forum out - itz MUCH MORE USEFUL than this forum. Pople are willing to give a full description

and example :

My qsn:

Hello there...

Im having the following problem :

My project is about Car pooling system.
Now i need to create a form , that has 2 buttons, this will open 2 forms:

1. Car check in
2. Car check out.

i can manage that bit.

What i can't do is:

I have to make the two forms such that the records cannot be altered in any way, EXCEPT, using the button which might say "check out?". If clicked on this, that record should be removed from the "CAR CHECK OUT" form, and go into the "CAR CHECK IN" form. So later, when the car is returned, the user will go to the "CAR CHECK IN" form, and click on the box that might say "check out?" again, so it is de-selected, and the record will go back to the "CAR CHECK OUT" form.

and the answer is "astonisingly" (for this forum) longer than the question with all information "USEFUL"

Answer:

Umm Why? I assume you want to maintain a record of when the car is checked in and out. First I would have a tblHistory table like this:

HistoryID (PK Autonumber)
CarID (Foreign key to cars table)
InOut
HistoryTime

So I would have ONE form with the Data Entry property set to Yes so the user can only enter records, not edit them. On that form have a combobox where the user selects the car and a button to save the record the button would initially have its Visible property set to No. I would also have two hidden textboxes that are bound to InOut and Historytime fields.

Next I would create a query on tblHistory where the SQL would look like this:
SELECT TOP 1 HistoryTime, InOut FROM tblHistory WHERE CarID = Forms!Formname!cboCar;

Next I would have the following in the After Update event of the cboCar (the Car combo)

Dim intInOut as Integer

intInOut = DLookup("[InOut]","qryLastActivity")

If intInOut = 1 Then
Me!cmdInOut.Caption = "Check Out"
Else
Me!cmdInOut.Caption = "Check In"
End If

Me!cmdInOut.Visible = True

Finally, behind the Button (cmdInOut) I would use the following code:

If Me!cmdInOut.Caption = "Check In" then
Me!txtInOut = 1
Else
Me!txtInOut = 2
End If

Me!txtHistoryTime = Now()

DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70

DoCmd.Close acForm "formname"

The result here is the ueser selects a car and a command button becomes visible with the caption Check In or Out depending on the last activity of the car. When they press the button, controls are populated indicating whether the record should be an check in or out and the time. The record is saved and the form closed.

HTH

Now that is USEFUL information, and polite talking.

SJ you are just so rude.. i guess it's cause of your ego, that you're the mod, or ego that you know a lot about access....

but HEY ... ure not the best !

so fot the ppl interested in the forum .. here you go -

Code:
http://www.utteraccess.com/forums/
 
Last edited:

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 14:27
Joined
Jul 9, 2003
Messages
16,280
still_rookie said:
i don't have any records in my database AS YET.. which is why.. i don't get a proper SQL code from the query editor...

No, that's not it, it doesn't matter whether there are records in your tables or not the query builder will still build SQL for you.
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 14:27
Joined
Jul 9, 2003
Messages
16,280
Oh! I didn't realize you had got bitchy again! I thought you were going to behave yourself. If I had noticed, I would not have answered!

Anyway, as to your "final" parting shot you posted this:

>>>>>>>>>Hello there...

Im having the following problem :

My project is about Car pooling system.
Now i need to create a form , that has 2 buttons, this will open 2 forms:

1. Car check in
2. Car check out.

i can manage that bit.

What i can't do is:

I have to make the two forms such that the records cannot be altered in any way, EXCEPT, using the button which might say "check out?". If clicked on this, that record should be removed from the "CAR CHECK OUT" form, and go into the "CAR CHECK IN" form. So later, when the car is returned, the user will go to the "CAR CHECK IN" form, and click on the box that might say "check out?" again, so it is de-selected, and the record will go back to the "CAR CHECK OUT" form.<<<<<<

As an example of a question you posted in another forum, and you suggest that you got a far better response in the other forum than you did here. Well I am not surprised that you got a better response, because that is very nicely written Question, and I would imagine that anyone here would have been able to read it,understand it, and willing to help if possible. I'm amazed that you can actually write sensibly when you want to, if you had started writing here, that well then your experience here might have been a lot better!

Personally, I am not convinced that you are a "beginner" I am suspicious, I think you might be a reincarnation of a person that caused a lot of trouble on this forum in the past. Your posts have the tone of a wind up merchant.
 

still_rookie

Registered User.
Local time
Today, 16:27
Joined
Apr 17, 2005
Messages
122
because that is very nicely written Question, and I would imagine that anyone here would have been able to read it,understand it, and willing to help if possible.

HAHAHAHAH !!! OMG !! LISTEN TO THIS !

you know somin uncle gizmo ... I POSTED THE EXACT SAME COPY OF THE QUESTION ON THIS FORUM! IN THE GENERAL SECTION ! .... i also PLEADED for an answer... but you no1 bothered to answer.. itz got SOO many views.

Oh! I didn't realize you had got bitchy again!

yes i have, not cuz im fond of it, just cuz ppl like SJ Mc... watever his name is ... dont treat me properly, and also raskew (watever his name is too) ... personally... i dont blame you, cuz you are not rude and are very understanding...

the trouble makers in this forum are the 2 listen above... they just dont have the sense of how to talk formally... and im not the kind of guy just takes it... If you are rude and unformal.. it puts me off.. plus, their answers are almost close to useless.... what the hell ... go check my older posts... all SJ does is give 1 or 2 instructions... he dsnt even explain the whole answer .... :confused: thats not it... i don't know why, but both of them have a HUGE ego problem... ppl.. get rid of it soon ... because if ppl like me come here... you won't have a good time....

I don't want to abuse this forum.. but just because of some people.. this forum will start to have a bad reputation IF nothing is done about it soon...

anyway.. im not blackmailing you or anything.. just cautioning you... cuz im just 1 ... tomm there may be 2,3,4 or more who might "protest" if u wanna call it that way....

so anyway... forget what i asked you about.. i figured it out myself...

Thanks a LOT ! (sarcastic!)
 

Mile-O

Back once again...
Local time
Today, 14:27
Joined
Dec 10, 2002
Messages
11,316
still_rookie said:
cuz ppl like SJ Mc... watever his name is ... dont treat me properly
Act like an adult and you'll get treated like one. Act like a whiny kid and you'll get treated like one.

they just dont have the sense of how to talk formally

Have a look at this ongoing thread. Notice the difference in tone betwen the person with the problem and you?

all SJ does is give 1 or 2 instructions... he dsnt even explain the whole answer ....

There's a reason for that. It's better to give someone a nod in the correct direction. That's usually all they need and, when the penny drops, they can quite happily continue with their database. You, on the other hand, don't appear to have ever used MS Access and certainly don't seem willing to help yourself to learn how to use it. You get nods in the correct direction and, because you don't understand them you whinge and moan. If you don't understand then be adult/honest and say so; you are more likely to get a more detailed and considerate response. Raskew also gave you a complete solution and you obviously didn't bother to try it - what are we to do if you don't seem willing to use a bit of initiative to solve problems.

If I remember correctly you said on another thread that this is a school project that you are doing. What has the school been teaching you? A huge part of development, design, and programming is being logical and using your initiative.
 

still_rookie

Registered User.
Local time
Today, 16:27
Joined
Apr 17, 2005
Messages
122
omg man... ull never understand...

Have a look at this ongoing thread. Notice the difference in tone betwen the person with the problem and you?

That doesn't look like a "nod" to me... that look like a whole freaking asnwer to his life time problems...

and btw.. itz not me who's acting like a kid.. its you ... from day 1 your like this.. and whatever ppl may tell you, you just dont seem to get the hint.

You said raskew gave me a solution and i ddnt try it... so i u think im "whinging and moaning" for nothing ?? you think im that bothered to post a reply that says it doesn't work when it does ???

Well think again...

and what the hell do you know about how much i know and how much ive don e ?? ive posted my db in 1 of the posts here... take a look ... you might be impressed... but most probably, ull just come back and "abuse" ,like you say.

anyway ... i can argue with you forever like this... So ... "HINT HINT"
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 14:27
Joined
Jul 9, 2003
Messages
16,280
still_rookie said:
but you no1 bothered to answer.. itz got SOO many views.

I see, well I am sorry nobody bothered to answer your question the first time around but you must understand that most of us have jobs to do and come to this site in our free time, I usually come on here weekends & evenings.

The only reason I can imagine your question was not answered, was because you were unfortunate that the particular person with a particular knowledge didn't see it.

As to the number of views you indicate for the question, then that is a plus really isn't it, it means that your question got a lot of attention. But unfortunately not from the right person.

I personally prefer Answering questions about combo boxes, about opening forms and displaying particular data. I avoid any questions on table design, reports and some very complicated SQL type of questions. I am starting to answer questions on SQL and my SQL is improving, I am starting to answer more and more advanced SQL questions. I would imagine that other people have their own particular preferences.

The reason I do this is that by answering questions on the edge of my understanding I have to think about things that do not normally cropped up in my everyday work, so hopefully my knowledge and understanding of MS Access will improve. unfortunately, I occasionally give the wrong answer, or get hold of the wrong end of the stick and answer the wrong question. This is also an important part of learning, these mistakes I make are helping me become better at answering questions. Obviously this will also help me in my work, because the one aspect of being effective in work is providing good communication. Any improvement in my communication is obviously a bonus. And believe it or not, another reason that I answer questions is that I enjoy doing it!

I think that you may benefit from attempting to answer some questions yourself, you may then begin to see the other side of the coin, and maybe that will help you with your attitude!

Finally...
THIS......
>>>>>but you no1 bothered to answer.. itz got SOO many views<<<<

It is surprisingly difficult to read. You put >>> no1<<< instead of >>> no one<<<< but when I read it first time I thought it meant >>> Number 1 <<<<

the rest of the text is slightly better, slightly easier to read, but why? Why should I bother to read it? There are other people who post, who post properly, well written , and easy to read questions.

The problem for me, and I would imagine others answering questions, is that there is no correct format for asking a question. And because most people here are new to MS Access, they are not yet familiar with the terms used in access , for example there are >>>tables <<< which have, columns, fields, rows, there are forms would have on them controls , text boxes , combo boxes, list boxes, check boxes, subforms...

So when you see a question, the first task is to read it! What is the person really asking! And this is quite difficult, the point I'm trying to make, is that you do not really need the extra task of deciphering some modern way of writing. So you will be doing yourself a big favor, by writing your text out in formal English. If you don't, some people are going to skip over it and find a question that is easier to read. In fact after this experience with you, which really has been a complete waste of time for everyone involved, I have decided that if I find a question difficult to read, I am going to ask the person to rewrite it.
 

still_rookie

Registered User.
Local time
Today, 16:27
Joined
Apr 17, 2005
Messages
122
unfortunately, I occasionally give the wrong answer

that fine... atlest you admit that your not perfect... but some people here.. dont even try to get over their ego. And i contunally Emphasise on the word 'ego' because you know it,, he knows it everyone knows it.. but there is no action taken against it...

I think that you may benefit from attempting to answer some questions yourself
I have tried to answer a few questions here... :)

anyway... i guess there is no solution to this problem ... so i will just have to live with it.. anyway.. im used to it by now and after all this..
 

Mile-O

Back once again...
Local time
Today, 14:27
Joined
Dec 10, 2002
Messages
11,316
still_rookie said:
but some people here.. dont even try to get over their ego.

Yes, I've noticed. You should really do something about it. Personally, I know I have an ego but who doesn't? Some, (i.e. yours) are just over the top and have a very solipsistic feeling.

but there is no action taken against it...

If you have a problem with any of my posts then I can happily direct you to the Report this post icon at the top right of each post where you can highlight your problem to the other members of the moderating team - I won't receive the message since it would be me that you are reporting.

i guess there is no solution to this problem

You have been given it but you seem to think it doesn't work. Rather than admitting you don't understand you have wandered off the course of the topic. You've been told the solution but you still say that you guess there is no solution so I suggest that if you have any encyclopaedias at home that you give them away as you obviously know everything.

Regarding this earlier comment:

That doesn't look like a "nod" to me... that look like a whole freaking asnwer to his life time problems...

The first post I made was a nod, they responded saying they didn't understand so I was happier to expand. They were also civil. :)

So, you've been responded to my numerous members of this forum about your style and have still never adapted it to gain any form of respect. You complain about how rude people are when they are not being rude but are, due to busy lives, being straightforward with you. If you want a more sycophantic approach to your problems then I suggest you take a tour on the American chat show circuit - maybe you can promote your database while you do it.
 

still_rookie

Registered User.
Local time
Today, 16:27
Joined
Apr 17, 2005
Messages
122
itz funny how you and some other ppl have the problem.. other forums are so cool about all... i just think its a problem with YOUR attitude, please work on it...

its not affecting me much now because i know many more forums on access... and they dont just nod, they explain in detail and give their time and dont be lazy ...
 

still_rookie

Registered User.
Local time
Today, 16:27
Joined
Apr 17, 2005
Messages
122
yeah ive registered in all ov them ... besids these, there are 3 more forums which i have joined..
 

still_rookie

Registered User.
Local time
Today, 16:27
Joined
Apr 17, 2005
Messages
122
UFF... END OF THREAD BUDDY ... STOP IT NOW ... ITs OVER ! Dont start it again.
 

Users who are viewing this thread

Top Bottom