473,325 Members | 2,608 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,325 software developers and data experts.

replace table value

heres the situation. I have a table in access with some fields, 1 2 and 3. I have a form that i want you to enter text in a box, and for that text to replace a certain value in field 1.

Is there a script that can do this, or a command? I am so stuck on this.

I can call up the value that i want, and enter the new value, i just cant get them to swap.

thanks alot

Bill
Jul 29 '06 #1
6 2587
BSOB
77
that last word "swap" might be leading me down the wrong path, but it sounds like you want the text box to become the value, and the value to become the textbox at the same time. (i could be competely wrong but...)

try using a 3rd variable:
temperary variable = textbox
textbox = value
value = temperary variable

swapped?
Jul 30 '06 #2
do u want to update or insert these values in access?
Jul 31 '06 #3
Hi

Thank you very much for the replys. I dont think i made my question very clear. I have a table with three fields. User ID, User Name, and Password.

I have a form called "ChangePassword", where you can change the old password into a new one. You enter the User Name and password, and a then a new password that you want to change the old one into. If the user name and old password match, then the program continues and allows you to change passwords.

It works up to there. I cannot figure out how to get the visual basic to take the "old password" from the table, and replace it with the "New password" which was entered in the form, but has yet to be saved to a table or anything. I dont want to replace the username or ID, just swap passwords.

Is there a function that will do this?

say, declare the table password,

then declare the form entry (new password),

then replace the table password value with the new password value?
Jul 31 '06 #4
don't confuse ur self according to OLD and NEW password. What u have to do is, just update the New password in table i.e.

Update <Table Name> Set Old_Password_Field = New_Password_Field Where Old_Password_Field = <Old Password>

,after checking the username and old password, to confirm the modification. Means u have to just update the table in case of changing the password. just consider the old password as current password.

hopes u got the idea !!! :) :) :)
Mahesh
Jul 31 '06 #5
Mahesh_Bote,

Thank-you so much for your help, that was exactly what i was looking for.
Jul 31 '06 #6
ok,

Update tblEmployees
Set strEmpPassword = Me.NewPass
Where strEmpPassword = Me.OldPass.Value

that is what i entered in my VB.

strEmpPassword is the field in the employees table
OldPass is the name of the textbox in the form where the old password is entered,
likewise for the new password


when i run the code, it comes up with "Compile error, sub or function not recognized" and highlights the word <Update> in my code

any thoughts?
Jul 31 '06 #7

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

Similar topics

19
by: Westcoast Sheri | last post by:
To keep track of how many fruits my visitors buy, I use a mySQL database (2 columns: "fruit" and "quantity")....so can we make these following mySQL queries work somehow? (visitor buys 5...
12
by: Barnes | last post by:
Does anyone know of a good way to use the JavaScript string.replace() method in an ASP form? Here is the scenario: I have a form that cannot accept apostrophes. I want to use the replace() so...
3
by: o_swas | last post by:
Hello, I have a JavaScript string. I want to replace all consecutive occurrences of whitespace characters like spaces, tabs, newlines, and form feeds with another string. For example, say I...
2
by: Daniel | last post by:
I use an Access database to basically take data exports, import them, manipulate the data, and then turn them into exportable reports. I do this using numerous macros, and queries to get the data...
18
by: james | last post by:
Hi, I am loading a CSV file ( Comma Seperated Value) into a Richtext box. I have a routine that splits the data up when it hits the "," and then copies the results into a listbox. The data also...
3
by: Niyazi | last post by:
Hi all, I have a dataTable that contains nearly 38400 rows. In the dataTable consist of 3 column. column 1 Name: MUHNO column 2 Name: HESNO Column 3 Name: BALANCE Let me give you some...
9
by: MrHelpMe | last post by:
Hello again experts, I have successfully pulled data from an LDAP server and now what I want to do is drop the data into a database table. The following is my code that will insert the data but...
1
by: dewey | last post by:
Hi, This, I'm sure, is a very simple problem. I'm trying to use the xslt document() function to add a piece of information from a second xml file. The main xml has a list of football teams,...
1
by: zafar | last post by:
I need to replace a cell value in grid e.g i have field "user_gender" of data type int where 1 means male and 0 means female. i did not make parent table for "gender", because there is only 2...
6
by: JackpipE | last post by:
Here is my replace query and I need to run this on every column in my table. Right now I manually enter the column name (_LANGUAGES_SPOKEN) but this is time consuming and would like to automate...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.