472,354 Members | 1,114 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,354 software developers and data experts.

Form datasource as query problem.

13
Hi All,

another day another problem!

I have a SQL table shown on a form which i wish to filter by current logged in user -

I have a local table storing the currently logged in user and all records in the SQL table have a field called userEmail

so - i have forms that take their datasource from a query which then only shows the user his/her records.

SELECT *
FROM userDetails, dbo_TrackerMainData
WHERE (((dbo_TrackerMainData.userEmail)=userDetails.user email));

that works fine - after much torment, i figured out that you must use the query as the datasource and not the table as the datasource with a filter, because that just didn't work.

anyhoo.

my problem then is that when i use a form in this way - ie, datasource is a query, i can't then modify any data in the table!

I need to have a few checkboxes on the form that set values - for instance archiveFlag and TestFlag are fields and i need to be able to change their value.

If i set the form datasource to the table (dbo_TrackerMainData) it works ok - my check boxes tick and set -1 (but i see ALL records)

if i set the form datasource to the query i see only 'my' records, but when i try to click the checkboxes nothing happens..


any ideas?!

thanks
Aug 25 '07 #1
1 1707
Scott Price
1,384 Expert 1GB
If you create the query to only include your linked table (not using any criteria at this point, just a simple SELECT * FROM dbo_***) Can you do any update through the query?

If not, what is the nature of your link?

If so, set the WHERE criteria to use this kind of statement: =Forms!frmLogin!user_email

Where user_email is the name of the control that contains the users email address, and frmLogin, is any form that contains that information (you can even create a hidden form to use as a test in order to populate the WHERE criteria)

Regards,
Scott
Aug 25 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: MX1 | last post by:
I have a query written in MS Access that has a few calculated fields. Is it possible to refer to that query in a form field. I'd like the form field to show the sum of one of the columns from the...
3
by: MajorTom | last post by:
Hello everybody, I need help on how to use the same datase in two different form, this is the scenario: at the first form I load a big dataset (ds1) for short, but I not want to load it again...
3
by: Bill | last post by:
I have a seating chart web form that has over 50 entry field controls (tables/booths) where I use a DropDownList box to select a single company name from a single large list of organizations (200...
4
by: spamsickle | last post by:
I've created a query using the Query Designer under VB Express, and I can execute it in the Query Designer to verify that it returns the data I want. My database is called Area. It contains one...
2
by: Robert | last post by:
I am trying to give the user dynamic search capabilities to select almost any record in the database from criteria they select. Everything seems to work except when I open the display form to...
4
by: SHEBERT | last post by:
Here is an example of a SortedList that works as a datasource to the ComboBox and a generic SortedList<that does not works as a datasource to the ComboBox. Why? If I use List and generic List<>,...
2
by: windsorben | last post by:
I'm submitting a form to the same page. Form variables are being output into the URL and the query works from the URL variables. Problem is, I have submit the form twice before the form field I have...
8
by: hoofbeats95 | last post by:
I don't think this should be this complicated, but I can't figure it out. I've worked with C# for several years now, but in a web environment, not with windows form. I have a form with a query...
7
by: Rotsey | last post by:
Hi, I am loading a tab control on a form. The code loads textboxes and comboboxes and checkboxes, normal data entry form that loads a table row of data. I have a combo on the form above the...
2
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle...
1
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. header("Location:".$urlback); Is this the right layout the...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and credentials and received a successful connection...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...
0
by: Ricardo de Mila | last post by:
Dear people, good afternoon... I have a form in msAccess with lots of controls and a specific routine must be triggered if the mouse_down event happens in any control. Than I need to discover what...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.