473,396 Members | 1,871 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,396 software developers and data experts.

update table from form

HEy,

this is normally pretty basic stuff but i dont know if i'm tired or
what but right now i just can get it.

Heres the problem...

I have a form base on a table. 4 field : ID_Seller, Name_Saleman, Area,
ID_equipment.
I already have the ID and name entered in it. Now i want to be able to
add/change info in it, so normally i open the form and (i have a drop
down list to select the ID) select the ID. Everything is hook together
with Dlookup (from the ID_Seller).So as i select the ID, the name and
the rest of information comes with it. (but the record selector stays
at 1 - probably my problem). Now that I've selected the right ID, i
enter the area and ID equipment and when i try to save it, it says that
i cannot double the data in the field etc

All i want to do is be able to enter my missing data from the form..
thx

Nov 13 '05 #1
3 21485
i will ad some info...

i dont want to move with the record selector cuz it will take too long
to move from 1 to another record.
And my ID-Seller doesnt match my record like....ID 999 is the record 249

Nov 13 '05 #2
sounds like you're using an unbound form or at least unbound controls
to display the data for the selected ID. if you are using an unbound
control to display the data, or a calculated control, for that matter,
you can't save the data to the table, because the form doesn't know
what to do with it. to fix it:

first, you have to bind the form to the underlying table, and it sounds
like you'd best accomplish that for your purposes by using a query or
SQL statement for your Record Source for the form itself.

the form probably needs something like this for the Record Source:

SELECT SalesTable.Area, SalesTable.ID_equipment FROM SalesTable ORDER
BY SalesTable.Area;

then you'll have to build put a combination box (i think you said you
already have one to select the correct ID_Seller). that should be
unbound and in the header. It should have no Control Source (unbound)
and the Row Source should be set to an independent SQL statement to
give you all the seller IDs. This works best if those are maintained in
a seperate table as primary key values. that Control Source will look
like this:

SELECT SellerTable.ID_Seller FROM Seller.Table ORDER BY
SellerTable.ID_Seller;

the last thing you have to do is requery your selected data for your
Area and ID_equipment controls with the After Update event of the
ID_Seller combination box:

Sub cboIDSeller_AfterUpdate ()

Dim strIDSeller as String

strIDSeller = Me.cboIDSeller.Value
Me.RecordSource = "SELECT SalesTable.Area, SalesTable.ID_equipment " &
_
"FROM SalesTable " & _
"WHERE SalesTable.ID_Seller = """ & strIDSeller & """ " & _
"ORDER BY SalesTable.Area;"
Me.Requery

End Sub

that oughtta do it, unless there's something else about your question
that I don't understand.

Nov 13 '05 #3
thx i'll give it a shot

Nov 13 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: laurie | last post by:
Hi all, I'm trying to help out a friend who has inherited a client with a PHP shopping cart application. Neither of us know PHP, but I've been muddling my way through, trying to get these old...
0
by: Sue Adams | last post by:
I actually have two issues/questions: I have an autonumber field in an access db table that I grab and later use to update a record in another table withing the same db. The code I use to get...
3
by: Fredrik/Sweden | last post by:
Hi folks ! got this problem... i have a table 'Accounts' in my database, which contains a bunch of users. From the main menu i choose "edit user" and all users in the db are presented in a table....
4
by: John Baker | last post by:
Hi: I have two tables, a setup table (TblSetup) and a purchase order table (tblPO). When i construct a query with ONLY the tblPO shown, and a type in parameter for the PO number, I an update...
0
by: M. David Johnson | last post by:
I cannot get my OleDbDataAdapter to update my database table from my local dataset table. The Knowledge Base doesn't seem to help - see item 10 below. I have a Microsoft Access 2000 database...
5
by: cover | last post by:
I have an input form that passes data when submitted to a second form to let the user know what they have just entered into the db. My question comes with using 'update'. I'd like to query the...
16
by: Ian Davies | last post by:
Hello Needing help with a suitable solution. I have extracted records into a table under three columns 'category', 'comment' and share (the category column also holds the index no of the record...
16
by: ARC | last post by:
Hello all, So I'm knee deep in this import utility program, and am coming up with all sorts of "gotcha's!". 1st off. On a "Find Duplicates Query", does anyone have a good solution for...
11
by: stantron | last post by:
Setup: I only have one database with one table in it. The first page has a form that adds a record (w/ 6 fields in it) to the mySQL database's lone table via PHP. This works fine. I also have a PHP...
2
by: sirdavethebrave | last post by:
Hi guys - I have written a form, and a stored procedure to update the said form. It really is as simple as that. A user can go into the form, update some fields and hit the update button to...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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.