DLookup function to check if the password matches

First i have to say i appreciate all your help and patience. I know i am not the best one when it comes to programming, and especially in VBA, so therefore thanks for having the patience.

Anyways, this is what i did :

Changed the Table Bitumen, first for Laborant, it looked into tbllaborant for the name and initials, which resulted in the textbox being a dropdownmenu.. I made it a normal textbox instead.


I made a new form called Bitumen_Afkorting (english : Bitumen_Initials)

I made a textbox and defined it as =fGetEmpName(). Which works perfect.

Then i added a subform, which is the form i made earlier called Bitumen.

But then without the dropdownmenu for the users. I deleted it, and made a normal textbox instead, and defined the value as =fGetEmpName(), plus i defined the controlsource as Laborant from table Bitumen.

Thats where it gets messed up.

When u navigate through the records, using the new form, it seems to work perfect.

I see the initials of the person who worked on the data-entry, but when as soon as i get to a new and empty record, it takes the initials of the person who logged in, which is good, but it wont let me enter anything.

So that brings me to question 1 :

Do you have any idea what causes this?

And secondly,

Person A enters data into the database, and closes it. The next day Person B makes changed to the data-entry of Person A, is it possible that the Initials will change as soon as changes are being made.

Ive tried to do it within access itself using the different Event options, but no luck yet.

Again, the database is around 7mb now, so i can not upload to give u an idea of how i made it.

Is it possible to .rar the database, and devide it into 2mb files, and add them one at a time/ or all at once even ?
 
Person A enters data into the database, and closes it. The next day Person B makes changed to the data-entry of Person A, is it possible that the Initials will change as soon as changes are being made.

Do you want it to change? If not then it won't change since the control on the form isen't visible. If you looked at the sample db i uploaded you will see that I put =fGetUser() in the default poperty of the hidden control of the form with no subform.

This only added the user in dataentry mode aka newrecords.

If you want to change it then you must make the control visible for edit or run a update query to update the field in the table. But for data integrity I woulden't recomend that. Perhaps use an "AuditTrail" instead. You find a few treads on this subject on this subject.

I see the initials of the person who worked on the data-entry, but when as soon as i get to a new and empty record, it takes the initials of the person who logged in, which is good, but it wont let me enter anything.

So that brings me to question 1 :

Do you have any idea what causes this?

That depends on you setup, locked controls, form setup like AllowAddition etc. I can't give you an definite answer without seeing a sample db. If you strip out non-essensial stuff and zip it to get it under 2Gb

JR
 
Try opening this one.. I stripped the database to where u can only see Bitumen instead of all the other tests..

Well, basically i made a new empty one and imported the necesarry stuff.

Anyways, i hope u can open this, if not, could u tell me what msg ur getting ?
 

Attachments

First thing, in the form Bitmen_Afkorting you have some hidden controls that acts like lookup and linking fields to your subform Bitmen.

The control "Afkorting" is trying to Lookup the hidden control laborant on the parent form, but is missing the full refrence to this object. Change it to:

=Forms!Bitumen_Afkorting!laborant

Second, The linking control, labnr isen't set. Open the form "bitumen" and set the control's "labgegevens_labnr" controlsource to just

labnr

There are other controls on this complex form that I can't find refrence to like bookingnr which seems to belong in an other table so this suggest that you are trying to cram too much into 1 subform. I think you need to normalize your tables.

You also have a query called "querylabgegevens" which has 2 disconnected tables and that makes it a carthasian product and this type of query can't be used as a recordsource for a form, it's a READ-ONLY query.

Hope this clarify some of the problems.

JR
 
Thanks for your clarification, but theres just one thing i cant seem to understand.

How come i can edit the existing data just fine, but i can not add data to the existing table.

Is it because the query is "read-only"? But that would mean that i cant edit existing data right ?

Or is it because of the link between the 2 forms, in this case Bitumen and Bitumen_Afkorting...

Since the whole database is pretty much using "Labnr" as primary key, so basically "Labnr" is the glue that holds the tables together, wouldnt it be possible that i have to make a connection with both forms using "labnr" instead of Afkorting (Initials)..

If i can just add data to the tables using that form, and it automatically enters the users initials in "Laborant" then im happy, but like most things, it looks easier than it actually is..

Anyways, thanks again :)
 
The thing is..

When i replace the textbox 'Afkorting' with a dropdownmenu linked to tbllaborant, which is a linked tabel, it works fine.

I can select the initials from that dropdown menu, and add new a new record... No problem at all..

But that is THE thing i am trying to adjust to where it automatically enters the initials, so it can be saved into a table, for later generated reports etc.

There has gotta be a way to make that happen...

edit:

I think ive found the reason why its not saving anything the the tabel..


Theres a tabel named Contact and a table named Labegegevens, Contact is for contact information, and Labgegevens is for data and requirements for the lab, as in Labnumber and what kind of research needs to be done.

To combine those 2 tables, theres a querylabgegevens..

I added a table named Bitumen, which contains data entry of the Bitumen tests.

The table Bitumen and query Labgegevens are forming Querybitumen, which is being used to generate the form Bitumen.

Querybitumen checks what tests have been selected in tabel Labgegevens, and eventually calculate the results.

I think because the form is based on the query and not on the table, the data has become 'protected' or in other words, its on read-only.

And by data i mean all the information gathered from tabel labgegevens.

I think that is what u tried to explain a few replies back....

Anyways, so i either have to rebuild the tables, change the queries or redo the form... Any suggestions?
 
Last edited:

Users who are viewing this thread

Back
Top Bottom