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

Control Source

lee123
556 512MB
Hi there i have a form that i need help on, Maybe someone can help me.
on this form I have three txtboxes one is (the currect date),(orderdate),(duedate)
the orderdate has the date the order was picked up. The due date is set to the date the items must be returned or (one week). The current date is set for when the current date passes the due date it displays a message "past due"...By the way I have made this possible through the control source with this code:

current date code:

Expand|Select|Wrap|Line Numbers
  1. =IIf([DATEtxt]>[DUEDATE],"PAST DUE! ","NOT DUE YET")
then i decided to add a check box for when they did return the items the "past due" or the "not due yet" would disappear when i checked it but the problem is when i go to another order and go back to the same order the check box isn't checked any more it's greyed out.and either the "past due" still shows or "not due" still shows. How do i get it to stay checked when i go to another order or close the form and not be greyed out.. the code i have in the check box is this:

Expand|Select|Wrap|Line Numbers
  1. Private Sub RETURNEDTXT_Click()
  2.  
  3.     If RETURNEDTXT = True Then
  4.         Text12.Visible = False
  5.         Text3.Visible = False
  6. Else
  7.     Text12.Visible = True
  8.         Text3.Visible = True
  9. End If
  10.  
  11. End Sub


or is there another code or if this code is wrong in short HELP!!!!

LEE 123
Jul 13 '07 #1
11 1824
Rabbit
12,516 Expert Mod 8TB
The only way for this to work is if you have a field in your table that marks if the item is returned. Is the checkbox a part of the table or form?
Jul 13 '07 #2
lee123
556 512MB
there is a field that is marked returned its the checkbox with the code:

Expand|Select|Wrap|Line Numbers
  1. Private Sub RETURNEDTXT_Click()
  2.  
  3.     If RETURNEDTXT = True Then
  4.         Text12.Visible = False
  5.         Text3.Visible = False
  6. Else
  7.     Text12.Visible = True
  8.         Text3.Visible = True
  9. End If
  10.  
  11. End Sub
but that don't work? theres got to be another way i hope

lee123
Jul 13 '07 #3
Rabbit
12,516 Expert Mod 8TB
You also have to put the code in the on current event of the form. This won't work if you're using a continuous form.
Jul 14 '07 #4
lee123
556 512MB
hi there it worked thanks i have another question if i was to put another text box to count down the days until it was due, then after it was due would minus days after it was due did i say that right for instance if it was due 7 days it would start at 7 and count down everyday after that until it came to the date it was due which would be zero then after the seven days it would minus the days like -1,-2,-3 could you help me with this because i tried alot of ways but can't figure out how this is done i done it once but i acccidently deleted it now i cant figure out how i did this plese help here are some of the codes i tried:



Expand|Select|Wrap|Line Numbers
  1. =[text9]-[duedate]
- this didn't work

Expand|Select|Wrap|Line Numbers
  1. =[text9]-count([duedate+1])
- this didn't work

what am i doing wrong?

lee123
Jul 15 '07 #5
Rabbit
12,516 Expert Mod 8TB
This will work if Text9's format is a date format. By default the format of a textbox is left blank.
Jul 16 '07 #6
lee123
556 512MB
is there a way to freeze the number that it counts to for instance when the date gets to the duedate the number it leaves is zero (right) ok i guess what i'm saying is lets say that the customer returnes the item -2 after the duedate and i click the returned checkbox is it possible to freeze that number so it stays there at -2 so when the next day comes around it still will say -2 and not go on to -3 the reason is when i put the code behind the returned checkbox such as this code:

Expand|Select|Wrap|Line Numbers
  1. if returned then
  2.    text14.locked.enabled = true
  3. else if
  4.    text14.locked.enabled = false
  5. End if
  6. End sub
maybe i did this wrong but i thought it would work but didn't By the way i put this code with the ( on click) event

is there a property that i can use for the freeze method and put a code behind it?

lee123
Jul 16 '07 #7
Rabbit
12,516 Expert Mod 8TB
You can't freeze the code because then there will be no value. The value of the text box is always calculated on the spot, it is not stored in the table. Instead, you should calculate the value based on the return date.
Jul 17 '07 #8
lee123
556 512MB
i don't understand what you mean, in the returned checkbox or duedate please explain

lee123
Jul 17 '07 #9
Rabbit
12,516 Expert Mod 8TB
I assume there's a date returned field. Basically you calculate the number of days overdue based on the value of the date returned date. That will give you a "frozen" value unless the date returned date changes. And if the date returned date is empty, then you calculate from the current date.
Jul 17 '07 #10
lee123
556 512MB
oh i see now thanks rabbit you've been a real big help.

lee123
Jul 17 '07 #11
Rabbit
12,516 Expert Mod 8TB
Not a problem, good luck.
Jul 17 '07 #12

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

Similar topics

0
by: Brett Gerhardi | last post by:
Hi all, I'm having a nightmare with Windows Installer projects and souce control. My situation is that I have a few related windows application / dlls, some generic shared library files and a...
4
by: Nicholas Then | last post by:
I am writing an ASP.NET application and I have a class that I have written to create a vCard...it just returns a string with all the necessarry info... Anyway...is there a way that I can create a...
2
by: RSB | last post by:
Hi Every one, I am currently using Visual Studio .Net and trying to open a project from SourceSafe and once i open the project for the first time i get the following error/warning... "The...
1
by: Roger | last post by:
I've got a continuous form based on a query the first 2 controls on the form are bound to columns in the query a third control (paymentAmount) is unbound I have a total control in the footer,...
1
by: Vladimír Kolesnik | last post by:
Hi, there we need help concerning setting project under source control. We want to have a project on the server, and developers in the local network working on this project. We decided to use...
2
by: Mike | last post by:
Hi, I am strugling with a simple problem which I can't seem to resolve. I have an asp.net page which contains a server-control (flytreeview, which is a kind of a tree to be exact). The tree is...
0
by: Don | last post by:
I have a page that has several controls on it and the controls are shown or hidden during postback. I show and hide them using the visible property. When I use 'view source' in Internet Explorer...
4
by: Dave Calkins | last post by:
I have a native Win32 C++ app built with Visual Studio 2005. I'd like to make use of a property grid control in this app. For an example of this, in Visual Studio, see the properties control...
14
by: Rolf Welskes | last post by:
Hello, I have an ObjectDataSource which has as business-object a simple array of strings. No problem. I have an own (custom) control to which I give the DataSourceId and in the custom-control...
3
by: ºa¤Ö | last post by:
We are developing ASP.NET web application and using Visual source safe (VSS) to control our source code We developed a user control and it will been used by different project. I know there have...
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...
1
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: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
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: 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.