473,465 Members | 1,962 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

populating fields on a form using other fields on that form

5 New Member
Here it is I have four fields on a form that come from a query. Fields a,b,c,d.
a is a text field that looks like a date 1/2/2009, b is a time that looks like 8:00:00 AM and c is a concatanated text field 1/2/2009 8:00:00 AM.

Now d is a Date/Time Field formated as General date . I want to set the control property of d to transfer the date which is a text field into the d field so it will be an actual date. So I entered as the control property =[C] . I saved the record , closed the form and looked at the table that has a,b,c,d . The d field remains empty. Why ?? I also tried as the control property =CDate([C]) still doesn't work. Lastly I created an update query on the table and tried to update the d field and no go. Help
Nov 18 '09 #1
8 1672
NeoPa
32,556 Recognized Expert Moderator MVP
You can only sensibly do this with the Update Query approach.

Having said that of course, the whole concept is highly dodgy. You really do not want to duplicate data in your database instead of simply working it out on the fly. See Normalisation and Table structures for a full explanation why.
Nov 19 '09 #2
dupontk
5 New Member
I realize what you are saying but to avoid having someone type in the date and time in a field on the form, All they have to do is type the date and from a pull down combo box select the time, You might appreciate the problem of entering all the / and colons and getting the date corectly formated on data entry. I figured I could assist with pull downs. I don't mind the duplication since this project will not contain thousands of records. Ken
Nov 19 '09 #3
NeoPa
32,556 Recognized Expert Moderator MVP
@dupontk
I doubt you do, or at least you don't understand the full ramifications of that approach.

That said, it's really your funeral and if you want to update the field (d) then I can help you do that.

Let's take it from what you have already tried. Can you post the SQL for the update query you tried. From that I will see your actual field names and table name etc.
Nov 19 '09 #4
dupontk
5 New Member
Expand|Select|Wrap|Line Numbers
  1. UPDATE test SET test.d = CDate([C]), test.g = CDate([f]);
I tried it with d=[C] and g = [F]
Nov 19 '09 #5
NeoPa
32,556 Recognized Expert Moderator MVP
I would expect that to work Ken.

Can you explain what did happen when it was run.

I'm ignoring the [G] bit as this wasn't part of the original question. For (good) reasons of simplification I expect.
Nov 19 '09 #6
dupontk
5 New Member
When I ran the Update query it said 1 record not updated due to data type conversion.
Nov 19 '09 #7
dupontk
5 New Member
Hey I got it. I had to run 2 update queries . I thank you for the help. Your invited to the funeral.
Nov 19 '09 #8
NeoPa
32,556 Recognized Expert Moderator MVP
@dupontk
You shouldn't need two queries (I'm assuming you're talking about one for each field). Did you note the data in the record that didn't get updated? It probably contained some string data that couldn't be interpreted as a date for some reason.
@dupontk
Things going that well huh :D

No worries, we can help you past some of the difficulties.
Nov 19 '09 #9

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

Similar topics

7
by: Drew | last post by:
I have a db table like the following, UID, int auto-increment RegNo Person Relation YearsKnown Now here is some sample data from this table,
4
by: Lumpierbritches | last post by:
Thank you once again for any and all assistance. I'm building an application that's getting quite bulky due to the number of forms, macros and procedures. I was wondering if there's a way to use 1...
1
by: emmaruwa | last post by:
I have a form with two text boxes (in its details section) that pull data from two fields in my database table. This same form also has a button beside the text boxes which is supposed to open...
13
by: Mary | last post by:
I'll pulling my hair out on this one and would be so appreciative of any help. I am creating a data entry form to enter results of a student survey. There are 40 questions on the survey. The...
27
by: wideasleep | last post by:
Hello, I have a form that has a combo box that populates other fields. This works great but it doesn't save that information in the table where those fields are coming from. The only one that's...
4
by: prosad | last post by:
hello, Just solved a problem using Javascript onclick, can click on any cell in a dynamic table and it will pass the innerText object value to my form text field. parts of code given below: ...
0
by: daverskully | last post by:
I have two tables created and want to link two forms created from these tables so that specific fields are populated once one field is selected, but not all fields being populated, with a new record...
2
by: daverskully | last post by:
I have two tables created and want to link two forms created from these tables so that specific fields are populated once one field is selected, but not all fields being populated, with a new record...
3
by: pzh20 | last post by:
I have an unbound form/subform where I populate a combo box on the main form, and using the onchange event, display fields from a table in a datasheet subform. I want to add a new record via the...
3
by: davenumber40 | last post by:
I’m creating a small database in Access 2003(XP) to track issues during software testing. As far as databases go, it’s going to be a relatively small, short term project (No more than 20,000 records...
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...
1
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.