|
-
Dec 3rd, 2002, 09:22 AM
#1
Thread Starter
Hyperactive Member
Help on Several Things
I am using Access 2000 only. A front end and backend.
1) I have a form bound to a query. When the form opens I want it to open to blank fields not the data in the first or last record of the query.
2) I am rceiving an error "2465:Application-defined or Object-Defined Error. I do not know what thius means, and I can not identify.
3) Code to add one hour to the time value in a text box and populate another text box.
4) Someone with a brain for transplant. Mine is fried. hehe
Swoozie
Somedays you just should not get out of bed.
-
Dec 3rd, 2002, 11:00 AM
#2
Frenzied Member
1. Take a look at the DataEntry property (on the Data tab).
2. Where is the error occurring? What are you doing when it happens?
3. [in the ControlSource of your target textbox] =DateAdd("h",1,[originalField])
4. Mine's all gone too. Sorry. Too much Access programming!
-
Dec 3rd, 2002, 05:19 PM
#3
Thread Starter
Hyperactive Member
Thanks, I solved issue 2 and4 will never be solved.
The data Entry property doesnt help, because I change the record source through out the program 
And thanks for the time I could not remember how to do it.
Swoozie
Somedays you just should not get out of bed.
-
Dec 3rd, 2002, 09:04 PM
#4
Thread Starter
Hyperactive Member
Please look over the code. I am not sure what I am doing wrong. I am trying to take a time (9:00am) and add one hour to it.
It isnt working.
Dim arrival As Date
Dim EndTime As Date
If Not IsNull(Me.txt_ArrivalTime.Value) Then
arrival = (Me.txt_ArrivalTime.Value)
'Me.txt_ArrivalTime.Value is 9:00 am
'Arrival is returning a value of 12:00 am
EndTime = DateAdd("h", 1, [arrival])
MsgBox (EndTime)
Me.txt_EndTime.Value = EndTime
End If
Swoozie
Somedays you just should not get out of bed.
-
Dec 4th, 2002, 03:55 AM
#5
Frenzied Member
VB/VBA handles time in a slightly annoying way in that it is a Date/Time. Therefore, you might have to give it a dummy date. Try this:
VB Code:
Dim arrival As Date
Dim EndTime As Date
If Not IsNull(Me.txt_ArrivalTime.Value) Then
arrival = CDate("1/1/2001 " & CStr(Me.txt_ArrivalTime.Value))
'Me.txt_ArrivalTime.Value is 9:00 am
'Arrival is returning a value of 12:00 am
EndTime = DateAdd("h", 1, arrival)
MsgBox (EndTime)
'Me.txt_EndTime.Value = Format(EndTime, "hh:nn AM/PM")
End If
Glad you got 2 sorted. Are you still looking for a solution to 1?
-
Dec 4th, 2002, 10:30 PM
#6
Thread Starter
Hyperactive Member
I actually figured out the time thing in myself last night while I slept. Dreams are good for something.
I converted it to a sigular number added then passed it back to a time format. Worked great.
number one, I still havent solved. I am just making the user click the >* button at the bottom of the form untill I can figure out something else.
Swoozie
Somedays you just should not get out of bed.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|