yes, [Haircut Time] is in tblEmployee, in that sentence it is the only field referenced in the function, it can change depending on what procedure I choose on the combo box
well, in fact it was [Procedure Name] in the table, not [Procedure name},so, I already fixed that in the code...
I've double checked the spelling but no errors in the code neither on what the pop up error msg is suggesting
User Profile
Collapse
-
ok I tested both course of actions, none worked, same error 2471 happened. Also, it still highlights me the same line in yellow, this line :
TimeValProc = DLookup("[Haircut Time]", "tblEmploye e", zEmployeeID)Leave a comment:
-
ok, sorry for not understanding, but if by "resolve string" you mean what the immediate window says then it says this:
...Code:zProcedureName = [Procedure Name]= 'Haircut' zRsltProcedureName = Haircut zEmployeeID = '[Employee ID] = '1Haircut'' zProcedureName = [Procedure Name]= 'Haircut' zRsltProcedureName = Haircut zEmployeeID = '[Employee ID] = '1Haircut'' zProcedureName = [Procedure Name]= 'Haircut'
Leave a comment:
-
Ok, again, got a syntax error, but this time I added a extra ampersand here:
for the syntax error to go....Code:'" *&* zRsltProcedureName & "'"
now after running it, I got a new error that reads,
Runtime error 2471
"the expression you entered produced an error :
[Procedure Name] "
I already checked that's the name in the actual field...Leave a comment:
-
ok my form is linked to tblSchedule, I'll list the fields of both tables just in case....
tblSchedule
Employee ID-Autonumber
EmployeeName-short text
Start-date
Break-date
End-date
fields (that have to do with this issue) on my tblEmployee are
Employee ID-autonumber
Procedure name-short textLeave a comment:
-
The employee id Is a number in the table
ok, the immediate window says '1Haircut''
the 1 corresponds to the employee ID number
Haircut is the type of Procedure
so It seems I got a type mismatch between a number and a string, maybe?Leave a comment:
-
Okay, I fixed that after replying to your mail, apparently in the last lookup instruction in your code, there's the choke, a "type mysmatch in criteria expression" there:
TimeValProc = DLookup("[Haircut Time]", "tblEmploye e", zEmployeeID)Leave a comment:
-
ok, that's the version I have tried, your post #5 sir, it has a syntax error, and it's true, that I should be looking where the error is, I checked and re checked the code and still no success on finding the syntax error on the statement, I suspect it is on the commas before [txtID] it says, end of statement expected, also, this is my first program in access or any language...:
...Code:'build the second criteria string zEmployeeID
Leave a comment:
-
ok, but where should I upload the copy of the database, it doesn't have any real or sensitive info, since im still building itLeave a comment:
-
Hi, I read the post you suggested me, also copy pasted your code, in the lineSays I have a syntax error, which I can't see, maybe a comma, also, I'm a little curious why you declared timevalproc as Date?, I had it declared as string, does it has to do with the type mismatch problem? I also switched cbrocedure to cboProcedure... but it again,...Code:zEmployeeID = "[Employee ID] = '" [txtID] & zRsltProcedureName & "'"
Leave a comment:
-
Thank you both for your replies for the solution
Zmbd
1. I'm having trouble trying to adapt the ELookup to my scenario, I know It can evaluate 2 criterias but I can't find any examples to be able to do it
ADezii
2. I tried your first approach and it throws me an error
Run-Time error 2465
"My program can't find the field '|1' refferred in your expression."...Leave a comment:
-
multiple Dlookups for looking on values in multiple tables
I know I can look in two tables with d lookup
What I want is depending the case of what procedure I choose in a combo box, to look its time value in a employees table
timevalproc-The variable to assign the dlookup function in vba
tblEmployees
tblProcedure
[Haircut] or [Eyebrows] = [txt ID]
and the time for each of the procedures which is on tblEmployees:
I have this code as an... -
How to merge tables?
Hello, I made a tblEmployees with a first name and a last name field, I also have tblSchedule, which consists on employees and their start time, break time and a end time. My problem comes when I add a new employee, my tblEmployee adds the new record but my tblSchedule doesn't add any records, I know I can use a query, I used one, but it only shows all the records from tblSchedule...n ot the new ones I added in tblEmployees -
Syntax Error in data validation
Hi, I have 2 issues
1. I have a syntax error in this instruction and can't find what's wrong, I checked and rechecked it and counted if there was a parenthesis problem but I found 4 "(" and 4 ")" so eaach parenthesis symbol has it's other part.
2. Im building a query to test and validate that there is no collision in each of the appointments, I saw it on internet and decided to try it, since I'm... -
I found the solution!
1. FormatPercent(P ercComplete, 0) & " " & "Completed" , this will give me:
(i,e 18% Completed", 19% Completed, etc.
2. FormatPercent(P ercComplete, 1) & " " & "Completed" , this will give me:
(i,e 18.0% Completed", 19.2% Completed, etc.Leave a comment:
-
formatting numbers with percent
Hi, ok, I got 2 questions, I have a progress bar in access, along with the progress bar there is a percentage display label called lblFramePercent wich shows me the percentage completion, also I d my declared percComplete as single for showing me only entire numbers, but I defined perc complete like this
Me.lblFrameProg ress.Caption = PercComplete * 100 & "%" & "Completed! "
Now it shows me 16.00125%,... -
concatenating strings after update event
Im sure I've seen that I type a value in a text box and after I update the form it adds a string message...So, If I type 10 in a text box it adds the string next to what I type...
I want to concatenate strings in a textbox, like:
(i.e. "10" "minutes") -
Expected line or label statement or end of statement
I'm coding in vba in access and i'm trying to use a line of code for the Dateadd function but for some reason I am getting the error "Expected line or label statement or end of statement" can't find what's wrong since I used the same sentence in a control source of a textbox and it worked pretty well.... :/
Code:= DLookUp("[HC interval]","tblEmployee","[Employee ID]=" & [txtID]) -
adding hours + minutes with dateadd function
This is my first database in Access and I've been able to format and add date under 60 mins using the dateadd function... but I can't add dates OVER 1 hour like, 1:20, 1:25...etc...it just says type mismatch, and I can't find any solution to this problem, neither Microsoft or the web gives me any example of the Dateadd function when it comes to add hours + minutes ....
Code:DateAdd("n", d, l)...Code:DateAdd("H:N", d, -
No activity results to display
Show More
Leave a comment: