Creating Recordset With Only One Entry Per User

Nov 25, 2005

hi

i am trying to write a query to produce a descending recordset of photo_id but only one from each user e.g

if these are the top records

photo_id 150 m_name dave
photo_id 149 m_name dave
photo_id 148 m_name dave
photo_id 147 m_name john
photo_id 146 m_name john
photo_id 145 m_name fred

i want the query to produce this

photo_id 150 m_name dave
photo_id 147 m_name john
photo_id 145 m_name fred

and so on, there are other fields also but that gives you the idea i hope.
what i have come up with is this

SELECT MAX(FORUM_ALBUM.Photo_id) AS ID, FORUM_ALBUM.Photo_Name,FORUM_ALBUM_USERS.M_Name,FO RUM_ALBUM.Member_id
FROM FORUM_ALBUM, FORUM_ALBUM_USERS
WHERE FORUM_ALBUM.Member_id=FORUM_ALBUM_USERS.MEMBER_ID AND FORUM_ALBUM.Photo_Status=1
GROUP BY FORUM_ALBUM.Photo_id,FORUM_ALBUM.Photo_Name, FORUM_ALBUM_USERS.M_Name, FORUM_ALBUM.Member_id
ORDER BY FORUM_ALBUM.Photo_id DESC;

this gives me the records i want in the correct order but it gives multiple instances of each M_Name instead of just one record for each M_Name

i hope i have explained this clearly enough

thanks

Dave

View Replies


ADVERTISEMENT

Modules & VBA :: Recordset Loop Skipping Entry?

Jun 26, 2015

I have 2 identical tables of asset information. Table 1 has 251 records while table 2 has 84 records. All 84 records are in table 1 right now. My end goal is to be able to click a button, have vba script run, and table 2 updates table 1 with any changes from different fields. I know there are merging options with query and what not but the exact structure of my tables doesnt play well with it.

Right now, my code is able to loop through the values of each computername and display it. For some reason, when it gets to the 130th record of table one, the loop skips it and returns the 131st record, it stays one ahead for the rest of the loop and then prints the 130th record finally.

Since I am trying to compare field values, this sudden shift throws everything off. why it skips?

Code:

Option Compare Database
Private Sub UpdateAssetsBTN_Click()
On Error GoTo Err_Proc
Dim rs1 As DAO.Recordset
Dim rs2 As DAO.Recordset

[code]....

View 2 Replies View Related

Creating A New Access Table From A Recordset

Jul 21, 2007

I'm experimenting in MS Access VBA reading from one MS Access application to another as visible in the code below. My problem is that I'm reading a recordset from an Access file and want to take that recordset (rec) to create a table in the current databank. If I run an cmd.commandtext "make table query" it runs the query across the connection and places the table in the remote database (as expected). Can I take the recordset and create a local table using ADODB command or is there a better approach. (I should note that the remote MS Access file does not have an .mdb suffix) Thanks in advance.

Sub get_indbyind()

Dim strInputfile As String
Dim dlgOpen As FileDialog
Dim bob As String
bob = Application.CurrentDb.Name

' select connection
Set dlgOpen = Application.FileDialog(msoFileDialogOpen)
With dlgOpen
.AllowMultiSelect = False
.Show
End With
strInputfile = dlgOpen.SelectedItems.Item(1)

' make connection
Dim cnn As ADODB.Connection
Set cnn = New ADODB.Connection
Dim strcnn As String
strcnn = "Provider=Microsoft.jet.OLEDB.4.0; Data Source=" & strInputfile
cnn.Open strcnn
' MsgBox "connection made"

' create recordset
Dim rec As ADODB.Recordset
Set rec = New ADODB.Recordset
rec.Open "SELECT * FROM SATransfers;", cnn

Dim n As Long
Dim i As Long

Do While Not rec.EOF
Debug.Print rec.Fields(0).Value; rec.Fields(1).Value; rec.Fields(2).Value; rec.Fields(3).Value
rec.MoveNext
Loop

' create table from connection cnn
Dim cmd As ADODB.Command
Set cmd = New ADODB.Command
Dim rs As New ADODB.Recordset
cmd.ActiveConnection = cnn
cmd.CommandText = "SELECT SATransfers * INTO tmp1 FROM SATransfers;"
Set rs = cmd.Execute


cnn.Close
Set cnn = Nothing
Set cmd = Nothing
End Sub

View 2 Replies View Related

Modules & VBA :: Creating Recordset - Using Array As Report Data Source

Apr 17, 2015

I've done some basic work with arrays.. writing array data to form list objects.. How to use an array as a data source for a report?

Would i need to create a recordset and populate it with the array, then bind the report to it ?

The reason I am asking is the previous developer here built every app using arrays and UDT's... the apps are completely disconnected from the data. Everything is loaded in to arrays..

View 2 Replies View Related

Creating Building Entry Log

Feb 21, 2007

I have been asked to add a building entry log (Session Log) for a gym members database I created 2 years ago, unfortunately having racked my brain for the last week I am no nearer a solution.

Background:
I am a novice with a little knowledge (Dangerous I know), the main structure of the database is Contact [Storing address and name], Payments [Storing membership info - renewal date etc] and Sessions [Storing session date & time] this sessions table was recently added as a stop gap measure to allow the staff to enter user sessions manually.

Problem:
System needs to log user as IN and record the current time on first entry of userID (5 digit number), then the second time userID is entered it must log user out and record the time.

Resources:
I have just a single laptop running windows 98SE, and a USB numeric keypad. I should be able to get hold of a second monitor if required, but beyond that it is a case of beg, borrow, or steal as my budget is ZERO.

Any help, or suggestions to get me on the right track would be greatly appreciated.

View 3 Replies View Related

Modules & VBA :: Update Recordset Based On User Input Box

Oct 13, 2014

I have a form in my front end database that is supposed to allow a user to search for a record based on account number and then make changes to the that record and for it to save in the back end database. I have the search function working where it populates different input boxes on the form with what is stored in the back end database but I cannot get the update function to work. I have tried to assign each input box with a variable and then run an Update SQL function to update each of the fields but the updates are not storing. Any example of a successful update statement that uses VBA variables in it or a way to update a specific record via a recordset type function?

View 8 Replies View Related

Query Creating With Form Entry

Apr 10, 2013

I need to create a form, in which would be a query at the bottom.

I have table f.e. "A" in which is all data about cars.
I have table "B" in which is all data about customers.

I would like to create form "B" - which would add new customers, but at the bottom of that form I would like to see tables "A" filtered results.

Something like: In form B I create new customer. When I insert what car they want and how much they can pay, at the bottom generates query which would show all possible results from table "A".

With one customer I know how to do it. But when I insert second customer in the form, that query stops working while it doesn't know from which entry it should take the information. I don't know how to tell, that the query should take the data from the customer ID1 when I'm looking customer ID1, and from customer IDX - when I'm looking customer IDX.

I thought, perhaps it possible to create button with macro - when I press the button it copies all data from the current entry, it pastes in the form where is only one entry and works with query, than generates the query results which will be showed in the same entry that I pressed the button.

View 3 Replies View Related

Creating A Multiple Entry Field

Oct 1, 2012

I have a Comments field on a form. I would like to set it up so that multiple comments can be added and logged at different times by different users. I have attached a picture of what I am looking to do.

View 4 Replies View Related

Forms :: Recordset Filters From One User Affecting All Users On A Form?

Jul 10, 2013

Here is the environment:

Currently, I have 10 Users running a front end form that connect to back end data where they add to current records and eventually check that the record is complete.

I also have an "Apply Filter" button on the right hand side of the form that allows the user to apply filters to the records to show specific data that is not complete.

I am currently hearing that while the user is working, whether they apply filter or not, it seems as though all of a sudden, all of their completed work dissapears from their recordset hence not allowing them to go back to make changes to it if needed. I can only conclude that when a different user clicks apply filter, all users are affect some how... here are some examples of the code for the filter:

Code:
Select Case [cboFilterValues] ' Where the user selects a filter parameter from a dropdown
Case "All Data"
strSQL = "SELECT * " & _
"FROM [Data Table] " & _
"WHERE [Complete] = No

Then it does:

Code:
Me.RecordSource = strSQL

I am basically trying to find a way where only the user wanting to view the filter is affected... FYI, the other users arent actually seeing all the filters from the other user filter choice, they simply loose all their completed work from their form.

View 1 Replies View Related

Creating A Table Based On The Latest Entry

Jun 14, 2005

I am working on a jobs database where employees enter information where the job is being handed off to. I want to create a table showing the latest job entry by date. The jobs are listed by "Job Number" and when I try to create a table and remove the duplicate "Job Number" it does not always remove the oldest entries.

Any help would be appreciated.

View 1 Replies View Related

Creating Offline Data Entry Form

Sep 19, 2015

We have a client who is using an Access 2013 DB (Office 2013 Pro Plus) with the Windows 10 operating system. They are working on implementing the infrastructure for using Office 2013 under the Office 365 subscription. The Access DB they are using is setup as 2 .accdb files, one that contains the back end data, and the other the objects for the UI.

They will soon be using MS Surface Pro tablets for their field personnel, and want a form that can be used for data entry while in the field.

We talked about creating a form that could be used offline (basically a new FE and BE) and routine that would do data synchronization back to the network database when submitted by the field personnel.

From online research, it looks like this may be better solved with the use of Office 365, SharePoint, and Access Services. Unfortunately, since they haven't yet migrated to Office 365, we have no way to test it and need to determine if it is a viable option, or if we will need to do the "custom routine" option. Since they are planning to migrate to 365 anyway, if it works, it would obviously be a more cost effective solution for them.

Here are a few questions we have when considering this solution:

1) The Internet is not always available in the field, so the solution must be one that can run offline. Is this possible with 365?
2) They are working to get Sharepoint Services working soon. It looks like we will also need them to implement Access Services. What do SPS and Access Services look like, how do they interact, and what features do they offer and how can we leverage them?
3) What does the web-based Access application look like? What is the path to convert/migrate an Access 2013 DB to a web app? Does all development need to be done (or redone) in a new dev environment for 2013 web apps?
4) The "hydration" of an offline copy of the form is what we would need to distribute to an offline tablet device. What does this involve? Is a small footprint .accdw created? What happens after that when first accessed by the user? Is there a hydrated .accdb for the Front End and/or Back End?
5) If we must hydrate the entire application, we may need to implement security at that time. From our research, it appears that once the Access web app is published to SPS, the objects (lists, etc.) in SPS are lockable at the SPS level, and we may have to use that security layer instead of Access security, correct?

View 3 Replies View Related

User Friendly Data Entry

Jun 29, 2006

Please Exuse the question I am about to ask. I am a bit rusty with Access and cant remember how to do the following. I have tried and tried to work it out and tried various help searches but cant get the answer I'm looking for.

What I need to do is create a data entry form, very simple! However I want the user to be prompted to enter a project name and number in order to find the project that i want the new data to be entered under. Then it will need to create a new record in that project ready for new data to be entered from the data entry form.

I hope it is clear what I need to do

View 1 Replies View Related

User Must Save On Form Or No Entry

Feb 3, 2005

Hello,

Can someone please tell me how to make it so that a user must save on a form or there is nothing entered into the table? As it stands anyone who views the form creates a new record.

Thanks in advance!

View 4 Replies View Related

Forms :: Creating Data Entry Form With Hierarchy

Dec 6, 2013

I am tasked with creating a scientific database of fish catches at various different sampling stations. I envisage the entry form having a hierarchy, ie year, season, date, sample station, species caught, and then the specific associated data with each species (weight, abundance, length etc) will be a distinct record.

As fas as data entry is concerned, I would like the user to not have to re-enter the same information over and over when entering multiple species entries at the same sampling station, on the same date and so on up the hierarchy.

View 2 Replies View Related

Forms :: Creating Form For Data Entry On Three Tables?

Nov 19, 2013

How do I create a form that will allow me to enter data into three different tables?

I have a rather simple database for tracking students. When I get a new student I need to take information off their paper application and enter it into three separate tables, Student, Families, and Demographics. Each of these tables contains the fields StudentID, StudentFirst, and StudentLast.There is a relationship between the StudentID field on each table, with Student being the main table and Families and Demographics coming off of it. All relationships are one to many. StudentID is the key for the table Student.

I want to create a form to add a new record to each of these tables. I want my data to be displayed in the Columnar style. I only want to enter StudentID, StudentFirst and Studentlast once and have it populate to all three tables.

I can create a form and a query that displays existing entries exactly like how I want to enter them, but of course I can not edit or add to them. I have tried using subforms, but they don't seem to link up. Once I enter the Name, I want it to be on all the forms. I don't want to have type it three times. I also tried creating three separate forms and connect them with the Navigation Form. The issue again is that once I enter the name in one form, it is not automatically on the next form.

View 3 Replies View Related

Capturing User Name From Form Field Entry

Feb 6, 2007

In this db, the users select their name from a dropdown in an auto-open form, but with no password. I want to capture this value for use as the default value in a field on another form, but with the first form closed. I have seen the ENVIRON(Username) function referred to many times on here, but I need to capture the entered value, not the Windows or network login.

Is this possible without leaving the form open? I suppose I could just set its Visible to False when they enter their name, but I try not to have any more windows open than are necessary.

THANKS for your help!!

View 8 Replies View Related

URGENT!!! Time Registry On User Entry

Nov 21, 2006

Hi I'm a newbie in access, i've read almos all of the threads posted

my problem is that I need to register times

for example
I ask for user number (this is an exlcusive number)
and by the time User clicks on Accept i need acces to record this time

user 19394 time 7:35 am (for example)

can this be done in access??

and another i need acces to display a pop-up message like

"User 19394 Jhon Smith
is this correct?"

can you help me

View 1 Replies View Related

Modules & VBA :: Data Entry - Subform Creating Orphan Records

Feb 13, 2015

How do I display a more meaningful message instead of the cryptic error about having to enter data into blah blah blah. How can I trap that error and provide them a more meaningful message about entering data. I have tried the following;

Main form name frmPatientRecords
Sub form name DentalRecords Subform
Private Sub Form_BeforeUpdate(Cancel As Integer)
If Nz(tblPatientDetails!recordid, 0) = 0 Then
MsgBox ("sorry. Please complete the main record entry")
Parent.SetFocus
End If
End Sub

View 14 Replies View Related

General :: Creating A Form For Data Entry Into Main Table

Oct 21, 2014

I am creating a form for data entry into my main table. It shows all the fields including a name, date, id number etc.

I am trying to put a subform on the form containing a query. The query has two filter parameters fed from two unbound boxes on the main form (date and name). Their purpose is to filter records on the query to just show those for one person on one day. It also calculates a duration based on a start and end time. The query results are ok.

I can't get the query to display properly in the subform.

Subform Properties/data/source object is set to the query name. I'm told i have to link the master fields and child fields but when I try I get the error 'can't build a link between unbound forms'. I thought all that was necessary to bind forms was for there to be a common field between the form and query? Both contain fields from the main table including date, name, start time and end time etc.

View 4 Replies View Related

User Creating Their Own Queries

Mar 20, 2008

I want to keep the user away from the tables, but want them to beable to query the tables on their own from a selection on the Main Swichboard. My question is twofold, one being is this advisable and two how would I go about that? I can't seem to find anythng on it in my searches.

View 5 Replies View Related

Updating DB Only When User Clicks Save (and Not When Entry Fields Are Edited)

Oct 20, 2005

Hi,

I want to only save changes made to the DB row when the user clicks the Save button I created. I have some text boxes which currently are bound to different columns in the given row (ex: name, address).

Right now, changes are updated automatically when the form is closed or when focus moves to a different tab page.

Is there any simple way to do this? Currently all form input objects are bound to their respective columns (ex: name, address). Should they be bound, or should I just perform a query when the form opens to find the specified item then load the different fields into the proper text boxes.

Also, when I TAB through all my input boxes and the TAB focuses on my Tab Conrol Object the text boxes are automatically updated with the next item n the DB (next row). How can I prevent this?

Thanks!
DRT

View 1 Replies View Related

Forms :: Prevent User Navigating From A Field If Entry Is Invalid

Mar 5, 2013

I need to ensure that the data entered into a field on a form is correct. The field contains an email address and I have a function to check if the format is correct.

If the format is incorrect I need the cursor to return to the field in that record. The form is continuous.

What event should I use?

View 2 Replies View Related

Open Tab Control For Data Entry When No Records In Table For User?

Nov 29, 2014

I am trying to open TabCtl86 forms in AddData mode if there are no records in a table for a user chosen form cboClientSearch. The tab control has three pages on it. At the moment I am getting an error saying "the form named '0' is either misspelled or doesn't exist".

I am using this at the moment; DoCmd.OpenForm Controls!TabCtl86, acFormDS, , , acFormAdd, acDialog

View 1 Replies View Related

Creating A Multi User Enviroment

Mar 4, 2008

Hi, i have made many access databases which run on standalone machines and perform tasks such as invoicing, stock checking and various other tasks for businesses.

My problem is, I have just been asked to allow multi user access to the system with updates performed almost instantaneously.

Heres the setup:
Computer One - linked to - Computer Two (via a computer to computer network using a simple cat5e crossover cable to allow access to the files on each system).

What I need is to have the database file so that both users can access it at the same time and any updates are virtually instantaneous.

At the moment with only one pc, if someone was to create an invoice the stock levels would all update automatically in the system so if a stock check is performed the correct stock level is always shown as it is only run on the one computer.

What i need is to be able to have the system open on both pcs at the same time and if for example User 1 was to create an invoice, and User 2 was to perform a stock check shortly after, the updated stock levels would be shown.

I trully have no idea as to how to go about this, and would like to keep it as simple as possible. Any help would be much appreciated.

Many Thanks
Jared James

View 14 Replies View Related

New User Creating An Attendance Database

Jan 3, 2008

Hello, I am in the process of creating my database and I was looking for some guidance. My goal is to manage and track clients attending our program and ultimately being able to print and individual report with that information. Example: john doe on 12/28 attended 3 groups X,Y and Z.
I have created two tables one with the client's ID, name and starting date.
The second with the groups offered, the instructors and days and times of the groups.
The third I believe should be a dated table that would have groups and all the people who attended that day. This is where I am getting confused. I am not sure how to proceed.
Any ideas or suggestions would be welcomed.

Thanks in advance.

View 1 Replies View Related

Creating User Form Filter

Aug 2, 2005

Hi can anyone help me. I need to create a form filter that will allow a user to enter an amount into a text box and then run the filter to match the amount entered. I have tried creating a macro that will execute this but it wont work. any ideas?

Thanks

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved