473,325 Members | 2,860 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.

Data not save to table

Hi, I have a form which contains 2 fields: Minutes and Hours.
User enter the minutes then it automatically convert the minutes in term of hour.

If I set the control source of field "Hours" to =[Minutes]/60, the data will not be saved. If I set the Control Source of field "Hours" to "Hours", the data are save to the table.

How could I solve the proble.

I would appreciate for any help. Michelle
Dec 11 '06 #1
9 2145
MMcCarthy
14,534 Expert Mod 8TB
Hi, I have a form which contains 2 fields: Minutes and Hours.
User enter the minutes then it automatically convert the minutes in term of hour.

If I set the control source of field "Hours" to =[Minutes]/60, the data will not be saved. If I set the Control Source of field "Hours" to "Hours", the data are save to the table.

How could I solve the proble.

I would appreciate for any help. Michelle
Michelle

For adding new records the default value of the control being set to =[Minutes]/60 should solve your problem.

Otherwise you could put the following code in the After Update event of Minutes as follows:

Expand|Select|Wrap|Line Numbers
  1.  
  2. Private Sub Minutes_AfterUpdate()
  3.  
  4.    Me.Hours = Me.Minutes / 60
  5.  
  6. End Sub
  7.  
  8.  
Mary
Dec 11 '06 #2
NeoPa
32,556 Expert Mod 16PB
Hi, I have a form which contains 2 fields: Minutes and Hours.
User enter the minutes then it automatically convert the minutes in term of hour.

If I set the control source of field "Hours" to =[Minutes]/60, the data will not be saved. If I set the Control Source of field "Hours" to "Hours", the data are save to the table.

How could I solve the proble.

I would appreciate for any help. Michelle
Bind the control (Set the Control Source to Hours) then in the AfterUpdate event of the Minutes control add some code :
Expand|Select|Wrap|Line Numbers
  1. Me.Hours = Me.Minutes/60
Dec 11 '06 #3
NeoPa
32,556 Expert Mod 16PB
Setting the Default value is probably easier :).
I'm off to bed (She keeps beating me to the post and sometimes they're even better answers :().
Dec 11 '06 #4
MMcCarthy
14,534 Expert Mod 8TB
Bind the control (Set the Control Source to Hours) then in the AfterUpdate event of the Minutes control add some code :
Expand|Select|Wrap|Line Numbers
  1. Me.Hours = Me.Minutes/60
Too late Ade.

I got there before you.

Notice how I'm making nonsense posts. :D

Mary
Dec 11 '06 #5
NeoPa
32,556 Expert Mod 16PB
Too late Ade.

I got there before you.

Notice how I'm making nonsense posts. :D

Mary
At 02:30 I didn't even notice the obvious :(.
Lol -Ade.
Dec 11 '06 #6
It works except that "Me.Hours = Me.Minutes / 60" doesn't give the correct hour.
If I have 66 minutes, it only gives me 1 hour. But with [Minutes]/60, I get 1.1 hour

Michelle
Dec 11 '06 #7
NeoPa
32,556 Expert Mod 16PB
It works except that "Me.Hours = Me.Minutes / 60" doesn't give the correct hour.
If I have 66 minutes, it only gives me 1 hour. But with [Minutes]/60, I get 1.1 hour

Michelle
I'm not sure which you're saying is the good one.
But if setting the Default value works - look no further.
Dec 11 '06 #8
MMcCarthy
14,534 Expert Mod 8TB
I'm not sure which you're saying is the good one.
But if setting the Default value works - look no further.
Hi Ade

Sorted in separate post. Just had to change the number format of hours.

BTW Michelle,

Sorry I said data type instead of format in the other thread. Glad you got it sorted.

Mary
Dec 11 '06 #9
NeoPa
32,556 Expert Mod 16PB
Thanks Mary,

I saw the other post but didn't have time to 'moderate' it.
nvm - all sorted now.

Cheers -Ade.
Dec 12 '06 #10

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

Similar topics

3
by: Jerry Hull | last post by:
I've got a very simple database, with a report that the user wants to be able to print for a single record immediately after entering the data. I've created a button on the data entry form that...
3
by: sparks | last post by:
They have a new data collection station. The people here are using access 97.... This third party site will only post data back to us when we do this. ...
1
by: Sally Ruggero | last post by:
I need advice on archiving data from our production database. Each night I would like to save and remove a day's data from two weeks ago, from all the tables. I know how to delete the...
4
by: tarafinlay | last post by:
Hi all, I am new to access and am finding it a bit unintuitive having worked with SQL server in the past... And I am in a bit of a hurry because my employer wants me to crank something out which...
9
by: sellcraig | last post by:
Microsoft access 2 tables table "data main" contains a field called "code" table "ddw1" is created from a make table query of "data main" Goal- the data in "code" field in needs to...
0
by: amrhi | last post by:
Hy Guys , Can anybody help me ? I try to make small web database in my unit. Some of fields have on change behaviour to get other data that automatically filled other text field. But when i try to...
0
by: Jacob Donajkowski | last post by:
Once the user logs in I want to have the users switch from the Roster View to the Profile View and enter their profile infomation and save it. Then the next time they login and go to the Profile...
6
by: subhashkumar | last post by:
Running data Append to a table Dear All, I need a help from this forum, I was developing a small tools for stock market. I get stuck when trying to save the running changes in a data field...
2
by: rustyc | last post by:
Well, here's my first post in this forum (other than saying 'HI' over in the hi forum ;-) As I said over there: ... for a little side project at home, I'm writing a ham radio web site in...
1
by: semomaniz | last post by:
I have a form where i have created the form dynamically. First i manually added a panel control to the web page. Then i added another panel dynamically and inside this panel i created tables. I have...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
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...
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: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
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: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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.