By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,694 Members | 1,622 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,694 IT Pros & Developers. It's quick & easy.

Can anyone help me with this problem this code bring back no errors

P: 7
Expand|Select|Wrap|Line Numbers
  1. Public Function YearAdd()
  2. NextReveiw = DateAdd("yyyy", 1, [ReveiwDate])
  3. End Function
  5. Public Function DateDiff()
  6. ReveiwMonths = DateDiff("m", ReveiwDate, NextReveiw)
  7. End Function
  9. Private Sub Form_Current1()
  10.    If ReveiwMonths >= 1 Then
  11.       ReviewMonths.Visible = True
  12.       ReviewMonths_label.Visible = True
  13.      Else: ReveiwMonths.Visible = False
  14.       ReveiwMonths_label.Visible = False
  15.    End If
  16.    If ReveiwMonths <= 0 Then
  17.       MsgBox "Reveiw Is Overdue"
  18.       ReveiwMonths.Visible = False
  19.       ReveiwMonths_label.Visible = False
  20.     End If
  21.    If IsNull(ReveiwDate) Then
  22.       ReveiwMonths.Visible = False
  23.       ReveiwMonths_label.Visible = False
  24.    End If
  25. End Sub
Apr 22 '10 #1
Share this Question
Share on Google+
9 Replies

Expert 2.5K+
P: 3,525
O.P.:Can anyuone help me with this problem this code bring back no errors
If it has no errors then what's the problem? What do you need help with?

I recommend you read the FAQ about How to ask a good question so the volunteers will be able to help you.
Apr 22 '10 #2

Expert 2.5K+
P: 3,525
TIP: When you first created your question you were asked to wrap your code with [code] tags.

It really does help a bunch. Look how much easier it is to read now that someone has done it for you. Its the button with a '#' on it. More on tags. They're cool. Check'em out.
Apr 22 '10 #3

P: 7
It dosent work i have used the debug tool and im fairly sure it is written correctly i get no error messages but it just dose not do anything
Apr 22 '10 #4

Expert 2.5K+
P: 3,525
Habilatate: It dosent work
What does that mean? All code does exactly what you tell it to do: It can do nothing else. So by 'working' you must mean it doesn't produce the results you expected. But nobody here knows what you expect it to do: We only know what you coded it to do. Someone reading your code *might* be able to infer what you were trying to accomplish, but it would be a lot easier and lot less prone to mis-interpretation if you could tell us what you expected it to do.
Apr 22 '10 #5

Expert 2.5K+
P: 3,525
The code you have shown has a couple functions and a sub but there is no context of operation for us to see. We can't see your operation logic, meaning we don't have any idea when the sub is called. Does it happen when you click a button, when a timer expires, only once when the application is run
Apr 22 '10 #6

P: 7
Sorry for not being clear i appreciate your help the code is supposed to modify a form i am trying to create a new box which will tell me howmany months there are till an employees next reveiw there dosent appear to be any errors but i get nothing
Apr 22 '10 #7

Expert 2.5K+
P: 3,525
tlhIn'toq: But when does the function run?????
Maybe it doesn't 'work' because you never call it.
Apr 22 '10 #8

P: 7
what does that mean i am sorry to trouble you how do i call it any help would be really appreciatede
Apr 22 '10 #9

Expert 2.5K+
P: 3,525

I'm not trying to be rude. But "How do I write my first program?" is not something we can teach here.
Apr 22 '10 #10

Post your reply

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