Notices
Computer & Technology Related Post here for help and discussion of computing and related technology. Internet, TVs, phones, consoles, computers, tablets and any other gadgets.

MS Access Help (Simple one)

Thread Tools
 
Search this Thread
 
Old 15 August 2003, 01:05 PM
  #1  
jods
Scooby Senior
Thread Starter
 
jods's Avatar
 
Join Date: Feb 2002
Location: UK
Posts: 6,645
Received 0 Likes on 0 Posts
Post

Hi,

I need to know the syntax for SQL to select JUST the current record into a new table.

Currently the code says this

SELECT Help.CallNumber, Help.EmployeeID, Help.AssetID, Help.DateRaised, Help.Priority, Help.ProblemDescription, Help.Description, Help.Solution, Help.DateCompleted INTO Open
FROM Help
WHERE (((Help.DateCompleted) Is Null));

This makes a table which shows all calls without a completion date.

What I really really need is SQL that makes a table that ONLY has the current selected record.

Anyone got the answer

Old 15 August 2003, 01:31 PM
  #2  
chiark
Scooby Regular
 
chiark's Avatar
 
Join Date: Jun 2000
Posts: 13,735
Likes: 0
Received 0 Likes on 0 Posts
Post

What do you mean "current selected" - where is it selected?

Do you mean you select something on a form somewhere and u want to look it up, or do you mean the "latest" record?

Confused.

What you want to do should be very simple, but I don't know what you want to do - I'm being thick today.
Old 15 August 2003, 01:36 PM
  #3  
jods
Scooby Senior
Thread Starter
 
jods's Avatar
 
Join Date: Feb 2002
Location: UK
Posts: 6,645
Received 0 Likes on 0 Posts
Post

I have a form that users fill in to build their record.
this data is added to the Help table which has multiple records.

What I need is the button on that runs a query which makes another Table which contains only the current record that they have selected on the form.

If that makes sense
Old 15 August 2003, 01:37 PM
  #4  
jods
Scooby Senior
Thread Starter
 
jods's Avatar
 
Join Date: Feb 2002
Location: UK
Posts: 6,645
Received 0 Likes on 0 Posts
Post

something like

SELECT Help.CallNumber, Help.EmployeeID, Help.AssetID, Help.DateRaised, Help.Priority, Help.ProblemDescription, Help.Description, Help.Solution, Help.DateCompleted INTO Open
FROM Help
WHERE (((Help.record) Is CurrentRecord));

but SQL that works
Old 15 August 2003, 01:55 PM
  #5  
chiark
Scooby Regular
 
chiark's Avatar
 
Join Date: Jun 2000
Posts: 13,735
Likes: 0
Received 0 Likes on 0 Posts
Post

I guess callnumber is the primary key?

In which case, add a "where" clause to the sql that says something along the lines of...

WHERE callnumber = forms!yourformnamehere!callnumber

Old 15 August 2003, 03:08 PM
  #6  
jods
Scooby Senior
Thread Starter
 
jods's Avatar
 
Join Date: Feb 2002
Location: UK
Posts: 6,645
Received 0 Likes on 0 Posts
Talking

Button had this code

Private Sub CurrentCall_Click()
On Error GoTo Err_CurrentCall_Click

Dim stDocName As String

stDocName = "Current_Call"
DoCmd.OpenQuery stDocName, acNormal, acEdit

Exit_CurrentCall_Click:
Exit Sub

Err_CurrentCall_Click:
MsgBox Err.Description
Resume Exit_CurrentCall_Click

End Sub


Query was thus

SELECT Help.CallNumber, Help.EmployeeID, Help.AssetID, Help.DateRaised, Help.Priority, Help.ProblemDescription, Help.Description, Help.Solution, Help.DateCompleted INTO Open
FROM Help
WHERE (((Help.CallNumber)=[Forms]![Help]![CallNumber]));


Tada - It works perfectly (almost) Me happy
Related Topics
Thread
Thread Starter
Forum
Replies
Last Post
JimBowen
ICE
5
02 July 2023 01:54 PM
TylerD529
General Technical
2
09 October 2015 01:53 AM
Subaruswan
ScoobyNet General
14
01 October 2015 08:05 PM
Phil3822
General Technical
0
30 September 2015 06:29 PM
Littleted
Computer & Technology Related
4
25 September 2015 09:55 PM



Quick Reply: MS Access Help (Simple one)



All times are GMT +1. The time now is 08:49 AM.