473,395 Members | 1,730 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Editable forms

347 100+
I have a form that is based on and SQL query, i was hoping that i would be able to update some of the details in the form, mainly a comments text box for each entry in the DB. I have the properties set to allow edits, but it is not helping i just cant type anything into the textbox. I am wondering if this has something to do with the SQL as i did not write that part myself, im not sure what the group by bit does

here is the SQL

Expand|Select|Wrap|Line Numbers
  1. SELECT [mp3].[mp3id], [mp3].[File], [mp3].[location], [mp3].[Artist], [mp3].[Information], [mp3].[filename], [mp3].[Information]
  2. FROM mp3 INNER JOIN mp3voice ON [mp3].[mp3id]=[mp3voice].[mp3id]
  3. WHERE ([mp3voice].[Voice Type] In ([Forms]![Form1]![selected_type_1],[Forms]![Form1]![selected_type_2],[Forms]![Form1]![selected_type_3],[Forms]![Form1]![selected_type_4],[Forms]![Form1]![selected_type_5],[Forms]![Form1]![selected_type_6],[Forms]![Form1]![selected_type_7],[Forms]![Form1]![selected_type_8],[Forms]![Form1]![selected_type_9],[Forms]![Form1]![selected_type_10],[Forms]![Form1]![selected_type_11]))
  4. GROUP BY [mp3].[mp3id], [mp3].[File], [mp3].[location], [mp3].[Artist], [mp3].[Information], [mp3].[filename]
  5. HAVING (((Sum(1))=[Forms]![Form1]![HiddenObject]));
  6.  
  7.  

Any advice would be appreciated
Aug 13 '08 #1
10 1680
Stewart Ross
2,545 Expert Mod 2GB
Hi. Group By queries are not updatable I'm sorry to say. Such queries are generally used to provide totals etc at a level above that of the individual rows involved, so as it stands you can't keep the grouping if you want users to modify or add entries.

Looking at the query it does not appear to be doing any aggregation, so it may not be necessary to have the GROUP BY clauses at all. Open the query in design view and untick View, Totals, save it under a new name (so as not to overwrite the original for test purposes) then run the query and try modifying an entry. If all is ok you can just take the View, Totals off on the original query and your form should then be updatable for your users.

-Stewart
Aug 13 '08 #2
colinod
347 100+
thanks for that im not sure what the group by and having lines did but i took them out and the querys all work fine and i can edit fields in the form
Aug 13 '08 #3
NeoPa
32,556 Expert Mod 16PB
They changed the query from an editable one to one which wasn't :->

These things are usually left over from development or they have been nicked from somewhere else with similar requirements. Clearly this wasn't similar enough ;)

Nice spot by Stewart though:)
Aug 15 '08 #4
missinglinq
3,532 Expert 2GB
Since we've got Ade's attention, maybe he can explain why this post requires scrolling right thru about three pages to read an entire sentence? The problem appears localized to this thread.

BTW, Congrats, Ade, on passing the 10,000 post mark!

It's a shame the "scoreboard" on the main page on the forum only shows 7903!

Linq ;0)>
Aug 16 '08 #5
NeoPa
32,556 Expert Mod 16PB
Hey Linq.

I have no idea why that might be happening for you. I don't see anything different about this page. Sorry to be so little help.

On the scoreboard issue, 7,903 was the number of posts I've put in in the Access area. To see the quoted total (this doesn't include posts in the Moderators area) you can visit Bytes.com directly. The home page of the site lists all the top ten posters site-wide.
Aug 16 '08 #6
colinod
347 100+
Hi going back to the SQL the reason for the GROUP BY is because without it i cant get my results to return the files that inclued more than 1 word entered in the selected_type_* fields in my form, the idea is that you select a number of words from drop lists on a form and have the results returned if the file contains all the words
Aug 21 '08 #7
Stewart Ross
2,545 Expert Mod 2GB
Hi. We'd need more details to help you here, as you don't list the field names of the fields involved, nor where the count you refer to is located. This is not a GROUP BY issue; in post 1 there is a HAVING (WHERE) clause which is intended to restrict the records I guess in the way you mention. Unfortunately, the clause as listed is incorrect (involving SUM(1) which is just 1).

If you could tell me the names of the fields involved I can advise on what a suitable WHERE clause might be. Meantime, have a look again at your HAVING clause in post 1, remove the unnecessary SUM part, then try this as a WHERE clause in your SQL (making whatever changes you think necessary to the suspicious constant '1' listed which is meaningless to me) and see how you get on.

-Stewart
Aug 21 '08 #8
NeoPa
32,556 Expert Mod 16PB
Stewart, I think you may be mistaken about the Sum(1) part. It can have meaning (although the post is very unclear and offers too little explanatory information).

Think of Sum(1) as equivalent to Count(*).
Aug 21 '08 #9
Stewart Ross
2,545 Expert Mod 2GB
Thanks NeoPa - I'm confusing Excel's Sum function here, where beginner spreadsheet students often used cell formulas like =SUM([cell1]+[Cell2]+[Cell3]) when =[cell1]+[cell2]+[cell3] was enough.

Apologies to Colinod.

Whoever wrote the original did Colinod no favours...

-Stewart
Aug 21 '08 #10
Stewart Ross
2,545 Expert Mod 2GB
Since as NeoPa said Sum(1) is equivalent to Count(*), if it is necessary to compare a count of the rows to a control value in your query you should use the DCount domain function to do so instead. That way you won't end up with the query becoming non-updatable again as the result of using an aggregate function within it.

-Stewart
Aug 21 '08 #11

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

Similar topics

0
by: Faith | last post by:
I found code on www.codeproject.com. Here is a sample it is called DataGridColumnDropDown. I modified it to use the text box when I wanted it to depended on a certain search criteria. Public...
3
by: Young Seeker | last post by:
Hi, I created two forms using forms wizard. One was for a master table that has just an ID and Description column. Another was for a transaction table that has foreign keys from the master table...
1
by: dm_dal | last post by:
I'm looking for some feedback or for someone to point me in a good direction. We have a web application that consist of many forms. Some of our clients have asked if we can configure the app in...
3
by: S P Arif Sahari Wibowo | last post by:
Hi! I would like to make an editable continous form, where most fields will be from table A and editable, except 1-3 fields are a glimpse into table B and uneditable. Table A relate to table B...
4
by: Henry | last post by:
Hi all, I would like to use a control on a WebForm that acts like an editable DropDownList control. The user should be able to select a value from the list of choices, or type in a new value if...
1
by: planetthoughtful | last post by:
Hi All, I have a web page that presents records in a table, with one row per record. I'd like to put an edit button next to each record, such that if a user clicks on the edit button next to...
2
by: billa856 | last post by:
Hi, I have one projrct in MS Access. I have one form in which there is one Combobx(PalletNo_combo) and one Textbox(ShippedQuantity). Now when I select an item from Combobox then it will...
1
by: ramyasarangapani | last post by:
Hi, i have a issue in html.in a table,initially all the controls should be disabled.on click of edit link in each row,the respective row controls should be editable. i have not used forms.pls...
18
by: Andrus | last post by:
Marc, Thank you very much. I have issue on implementing add row properly using this. User presses down arrow in last row in grid starting adding new row. Then user changes its mind desiding...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.