User Profile

Collapse

Profile Sidebar

Collapse
slenish
slenish
Last Activity: Apr 30 '14, 11:38 AM
Joined: Feb 27 '10
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • slenish
    replied to How copy date from main form to subform?
    Hi Harry,
    Feels like I'm coming out of retirement to answer this one, haha. If I'm understanding the question correctly it sounds like you will want to use an IF statement or a Case statement to help catch a Null value. You could try something like...

    Code:
    If forms!mainform!text1 not is null then
         Me.text1= forms!mainform!text1
    End if
    I'm trying to recall this from memory so I haven't tested...
    See more | Go to post

    Leave a comment:


  • slenish
    replied to Update duplicate record (vba)
    Hi Seth / zmbd / Rabbit

    Thank you for all of your help. I ended up going with both options. I found benefits for using both in different ways. Is there a way i can select both answers to be the best answer?

    Thank you again and sorry it took me a little while to respond back.

    Slen
    See more | Go to post

    Leave a comment:


  • slenish
    replied to Update duplicate record (vba)
    Hi Seth,

    That adjustment did the trick. I have noticed an issue due to the .FindNext. Lets say i have two records if the old date is second and the new date is first in the record order than it works but if its the other way around it does not.I also tried .FindFirst ect and i get the same issue.

    I tried Rabbits idea but was not having any luck. If either of you could post an example i would apprecaite it.
    ...
    See more | Go to post

    Leave a comment:


  • slenish
    replied to Update duplicate record (vba)
    Hi Seth,

    You are amazing! Thank you very much for your reply and help! That worked great!

    Now i just need to adjust this to delete the original. I saw where you had the line rstShippers.Del ete but i removed it because i was getting an error due to it not being declared. Is there a way to create two bookmarks one for old and new then delete the old or delcare the old as OldValue then remove it?


    ...
    See more | Go to post

    Leave a comment:


  • slenish
    replied to Table not saving records
    What you might want to try (if you dont have it already) is add a button on the form that has to be pressed to save the record. In the OnClick event add in
    Code:
    DoCmd.GoToRecord,,acNewRec
    or
    Code:
    DoCmd.GoToRecord,,acNextRec
    .
    See more | Go to post
    Last edited by zmbd; Mar 27 '13, 08:27 PM. Reason: [Z{Please use the [CODE/] button to format posted code/html/sql - Please read the FAQ}]

    Leave a comment:


  • You could do what you need in a few different ways.

    1. Create a new form that is for user entry.
    2. Change the beforeUpdate event to DoCmd.GoToRecor d , , acNewRec
    3. Remove the BeforeUpdate event so it does not trigger the auto fill action.
    See more | Go to post

    Leave a comment:


  • slenish
    started a topic Update duplicate record (vba)

    Update duplicate record (vba)

    Hello all,

    Im looking for some help with duplicate records. I have a table that gets updated on a daily basis but each day the same record could show up on the table creating a duplicate.

    On the table i have a load date field so i can tell which record is old and new. What im trying to do is carry over the info from the new record to the old one keeping the original load date and then delete the new duplicated record....
    See more | Go to post

  • Hi dsatino,

    very nice my friend that worked perfectly.

    Originally I was trying that at then end of the statement

    ToNam = .fields(0) & ";"

    but was getting no where.

    Appreciate the help!!
    Slen
    See more | Go to post

    Leave a comment:


  • What do you mean by Append? Like an Append Query?
    See more | Go to post

    Leave a comment:


  • slenish
    started a topic Outlook To: field populates based on a table

    Outlook To: field populates based on a table

    Hello,

    I am using Access to Generate an Outlook Email based on a button click. Currently I have this working with no problem but I want to populate the To: field of the email based on email addresses that are listed in a table instead of hard coding them in. I currently have the below code working but it will only pull in the last email in the table. I was wondering if anyone could help me adjust it so it will loop through the table...
    See more | Go to post

  • slenish
    replied to Delete Duplicates with VBA
    Hi ADezii,

    Apprecaite your continued help with this.

    I tried your revision but it did not work. I made a small adjustment where I took out the >1 and for some reason that worked...any idea why?

    Code:
    Dim MyDB As DAO.Database 
    Dim rst As DAO.Recordset 
    Dim strCode As String 
      
    strCode = "YaDa" 
      
    Set MyDB = CurrentDb 
    Set rst = MyDB.OpenRecordset("Table1",
    ...
    See more | Go to post

    Leave a comment:


  • slenish
    replied to Delete Duplicates with VBA
    Going off of the code you did if I wanted to make adjustments to it so if I have a duplicate record the identifier would be strField1 (an ID #), in strField2 one record is Null and the other is Not Null and in a strField3 I could have two different values, for example code1 and code2. If I wanted to delete only the record where strField1 is a duplicate, strField2 is Null and strField3 = code2, how could I adjust this??

    I can get this...
    See more | Go to post

    Leave a comment:


  • slenish
    replied to Delete Duplicates with VBA
    An add on question for you,

    How would i modify this to check for duplicates and then if there is one value in the duplicate that is different to delete it?

    I tried something like this but i keep getting errors...
    Code:
    Dim MyDB As DAO.Database
    Dim rst As DAO.Recordset
      
    Set MyDB = CurrentDb
    Set rst = MyDB.OpenRecordset("tbl", dbOpenDynaset)
      
    With rst
    ...
    See more | Go to post

    Leave a comment:


  • slenish
    replied to Delete Duplicates with VBA
    Hi ADezii,

    Once again you skills are the stuff of legend. That worked a lot better. Now I just have to figure out how i can change it some to go in to a function :D

    Really appreciate your help!

    Is there anyway i can change your response to the correct answer?

    Slen
    See more | Go to post

    Leave a comment:


  • slenish
    replied to Delete Duplicates with VBA
    Thanks Rabbit,

    That was what I needed!

    I am still finding that it is not quite deleting all the duplicates which I think its because there might be some that could be triplicates.

    I will continue to play with it and see if i can figure it out. I apprecaite the help in getting me in the right direction.

    Thanks again,

    Slen :D
    See more | Go to post

    Leave a comment:


  • slenish
    replied to Delete Duplicates with VBA
    Mostly because I have code built that is doing a few other things to the table before and after finding the duplicates.

    I was trying to avoid the whole dup/append queries and then pull that information back in to the main table.

    slen :D
    See more | Go to post

    Leave a comment:


  • slenish
    started a topic Delete Duplicates with VBA

    Delete Duplicates with VBA

    Hello,

    I am trying to write a code that will look through a table for duplicates and delete them. I currently have a code I found on an older post in bytes that works fine for deleting duplicates but I am trying to figure out a way i can modify it to delete duplicates based on a criteria.

    I have been trying to change it so that if I have strField(1) that is Not Null and another strField(2) that Is Null and strField(1)...
    See more | Go to post

  • slenish
    replied to Check if a file is open in VB Script
    Well I guess I will answer this one myself since no one else replied and I figured it out.

    If you should have the same problem as me and you are trying to check if a file is open this is what i did...

    Code:
    Set objFSO = CreateObject("Scripting.FileSystemObject")
    
    File1 = "C:File location\file name.Open file type"
    'example since i was looking for a database that was open I did
    ...
    See more | Go to post

    Leave a comment:


  • slenish
    started a topic Check if a file is open in VB Script

    Check if a file is open in VB Script

    Hello,

    I have been searching and searching to try and find a way to check and see if a file is open or not but I have had no luck so far.

    The over all bigger picture is that I wrote a vb script to run as an update, but before running the update I want to check if the program is open or not and if it is to prompt the user that the program is open and that they need to close it before the update will run.
    ...
    See more | Go to post

  • slenish
    started a topic Copy and Paste Excel Sheet in to Outlook Email

    Copy and Paste Excel Sheet in to Outlook Email

    Hello,

    Ok I am having a problem where I am taking an Excel File and cutting and pasting the info from the first sheet into an Email on a button click on a form.

    I actually have it working but my problem is that it will only do it one time and then I have to close the database and re-open it to get it to work again. I think that the problem is that when the program executes I have it creating a temp file and copying...
    See more | Go to post
No activity results to display
Show More
Working...