Hi Jimmy. I'll throw out some guesses... Could you be successfully showing hours, but that dates are being missed. (In your example, you have 8*5 or 40 and you are showing 16 which is the remainder of hours after the date is in the ones place.) If this is the case than Narender's solution will work correctly for you if you are using code SQL.
If this isn't the case, I recommend, if you cannot upload a copy as Narender said, you...
User Profile
Collapse
-
First let me say that my comment was in no way a indictment of VBA. Only of my ability to figure out the problem. Per your request I am posting significant portions of my code. I fully agree it is clunky to build a separate macro to do this correctly.
This is on a form I use to order my records for priority testing. Clicking on this opens the specific testing request. This appears to work perfectly. The correct record...Leave a comment:
-
I want to apologize for my late response. I appreciate all of your help. I've decided to use a write around. For future reference here is what I found and did.
The VBA code to open the form works perfectly and always did. The correct record opens up. After the form is open, there is a reference issue where the first record is found through code, not the record currently displayed, even when referencing fields that have various names...Leave a comment:
-
Carl Witte started a topic Correct record and PK displayed. First record used when code on form called.in AccessCorrect record and PK displayed. First record used when code on form called.
Hi Folks. I'm lost and I can't find a spot where this answer exists. I'm opening a specific form to a specific record. Easy right?
Code:DoCmd.OpenForm "frm_WorkOrder", acNormal, , "[ID]=" & [ID], , acWindowNormal
The form opens up to the correct record. Then I have some code that runs after the form is open, the form displays the correct... -
Carl Witte replied to Primary Key need to be reconfigured to AutoNumber without changing the Field Data Typin AccessOk. This is probably silly as the other two guys who have commented know WAY more than I do. But here are two ideas, if I understand your goal correctly.
Both involve adding an autonumber field and then removing the now redundant short text field.
You could use a standard prefix "CUST" and then the autonumber field and eliminate the short text entirely. This doesn't change the underlying data type (long)...Leave a comment:
-
Ok. I now have figured out how to reconnect to the tables in SQL. I have to- delete the old table
- relink the table
- specify the primary key
This is clearly a bad idea. My code to do relink the tables is below. I feel like I'm close but I can't quite get there. Any help would be great.
Code:Public Function startup() Dim lclTBLstr(50) As String Dim sqlTBLstr(50) As String Dim countER As Integer
Leave a comment:
-
MS Access connection to SQL server via VBA
Hello. I have MS Access 2013 and I am trying and failing to programmaticall y connect to an sql server. Whenever I open a table (or do anything really) I get the manual connection screen and am able to reconnect manually. (See attached images for detail)
My goal would be to remove this manual connection screen through executing specific vba code at startup.
After research I have come up with the following code... -
You will need to add a integer variable
Code:dim responSE as integer response = msgbox("Warning",vbYesNo+vbdefaultbutton2,"WariningTitle") if response = vbno then goto Exit_supersub 'this allows me to change the type of the msgbox buttons elseif response = vbyes then 'run my queries end if Exit_supersup Exit Sub
Leave a comment:
-
You are asking for quite a lot here. Here are the basic steps you will need.- Find the right record
- Get that information someplace useful
- Play with that information.
Finding the right record is general done using a query. Assuming you have the person entered you can build a query that has the person, the task name, and the 'due date.'. Your criteria will be the person. You will by due date descending and you will find the first (oldest)...Leave a comment:
-
Thanks NeoPa. I put them in separate lines for personal clarity. That SQL statement is getting a little rough on a reader.
CarlLeave a comment:
-
Thank you ChipR. I'll try out the replace function. I must just only throw the errors with quotes and apostrophes. Clearly a problem with my coding that I keep throwing the same types of errors.
In the last week more than 8 out of 10 errors I've thrown are balked by the SQL system.
I'll have to use
Code:err_string = replace(err_string, chr(34), "<DQ>") ' fixes " err_string = replace(err_string,
Leave a comment:
-
Error logging
Hi. I've built a shared table to track errors from all users but I'm running into a problem. I populate this table with an SQL command. Many, maybe even most, errors have protected characters such as the apostrophe (') or a quote (") in them. To get arround this if there is a protected character it isn't logging the error description, just the number.
Code:DoCmd.RunSQL "INSERT INTO ErrLog ( [User], ErrorNum,
-
No problem. I probably wasn't clear in my original post. :-)
CarlLeave a comment:
-
Thank NeoPa. Missed it when I was looking through my search of the archives.
I'm using the wininet.dll with no problems for the transfer. My concern was after I have connected to the FTP site could outputto place the file there directly or did the file have to be written locally then transferred. It appears the answer is the file has to be written locally then transferred.
Thanks again for your help.
CarlLeave a comment:
-
-
Out of curiosity do you find the log file to be of particular use? To date I only create and use a log file when I have an error indicating a failure. CarlLeave a comment:
-
OutputTo command to an FTP
Hello. I'm using Access '07 and I need to regulariliy put a PDF on a FTP site. Can I do this directly with the outputto command?
Code:DoCmd.OutputTo acOutputForm, form_name, acFormatPDF, "ftp://files.myftpsite.com/" & lotnum & ".pdf", False
-
Business date difference
Has anyone got a good method to calculate buisness days differences or predict a date based on buisness days?
For example, If today 9/12 I place an order from vendor A they will say OK it will be ready in 10 business days. That means it will be ready on 9/26. If I had the same order on 8/29 I would have the order ready on 9/15.
My best idea is to put a table of dates that are holidays for my vendor (I have to... -
Its better. Seems to me that you are trying to calculate answers for some variables. I'd separate it into multiple queries. Call the first your "N" query. Perform your first calculation.
Making sure to use the "WHERE" your field for your data ="N"
Then make a second query called your "Not N" query.
Making sure to use the "WHERE" your field for your...Leave a comment:
-
I'm confused. Could you post a mathmatical formula of what exactly the transformation is supposed to be?Leave a comment:
No activity results to display
Show More
Leave a comment: