Access database 2007: I have a database with some forms init but when i type my username and password to open the main menu to insert data the form shows 1 second and closes the whole database. I don't know whether the problem is the VB code or the microsoft please help
check your vb code in your login form - comment out any code in which suppresses error messages then put a breakpoint in your code just after the user has entered their name and password (to do this, click on the relevant line and hit the F9 key, a maroon dot will appear and the line will also be highlighted maroon) Go through the login procedure and the code will stop at this point. So step through (hit the F8 button) until you find the problem - it may be in your login form or the form you are trying to open (in which case try looking at the form open, load and current events)
Well you're programming now. So what have you done regarding the basics. Put yourself in your accountant hat-- what would you do if a programmer came to you and said --
my bank book doesn't balance?
You'd expect that person to have some concept of arithmetic. Similarly here, we expect you to have a few analytic skills.
For example. to use Datediff(), you could go here to understand the syntax and see an example.
As CJ said, you'll have to do some learning --and don't overlook google to help you find examples.
Have you tried describing the steps you plan on doing in plain English? (eg a specification/plan). Debugging is a technique you should become familiar with.
Good luck.
Note: You posted while I was typing. You really have to do some research.
A comment at this level
can you tell me please what this 1650 means, I have no Idea why but its working
indicates to me you have done very little research.
How do you know "it" is working? Do you have any idea what the business logic is behind any of this?
Write a paragraph or a few points to identify WHAT you are trying to do in plain English, then repost.
We don't know anything about your database and vba code.
Who created the database? Do you have access to the user manual or the design specifications? Who normally operates the database?
How do you know it's working?????? Or do you mean, it doesn't STOP where it used to?
Well, to be honest, that does not mean anything is working.
What is your role in whatever you are trying to do? And what is it exactly that you are trying to do?
Private Sub Form_Load()
If DateDiff("d", Me.frm_limt!LIMT, Text51) >= 1650 Then
DoCmd.Quit
End If
End Sub
is a private procedure the executes when the Form is Loaded.
The If statement is a conditional statement -- much the same as
if I miss the bus, then I'll be late for the appointment.
The condition (translated to plain English) is If the number of days "d" between the value in the control LIMT on this form (form name frm_limt ) and the value in the textbox named Text51 on this form is greater than or equal to 1650, then
Quit the application.
If you are an accountant, you are familiar with
IF A is greater than or equal to B, then...do something.
exactly the same concept.
However, 1650 is some value that has significance in your application/environment. There is nothing generic or meaningful in the 1650 to any other situation.
Hopefully this clarifies things.
I must ask again, what exactly is your role in this database?
Just for clarity, most production databases (ones which are part of the business... accounts, receivables, inventory) are tested and follow maintenance procedures. They would normally have a current maintenance manual and an operator/user guide. In the case where a user/operator finds a "show stopping error", he/she would report the error to a support/tech team for resolution.
Hope that helps put some of the posts into context.
is it possible that whoever wrote this system does not work for you but has put some code in which prevents the system working after a period of time - in this context 1650 equates to 1650 days or approx. 4.5 years - to encourage you to reemploy him?