User Profile

Collapse

Profile Sidebar

Collapse
David Desormeau
David Desormeau
Last Activity: Aug 15 '11, 12:49 PM
Joined: Jul 13 '11
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Sorry for the double post, but I got the elseif part working. This is what I did (I only include the part I changed) :
    Code:
    ElseIf IsNull(DLookup("NoFacture", "TblRecomPaiementDet", "[NoFacture]= '" & Me.NoFacture & "'")) Then
        
        Dim db As DAO.Database
        Dim rst As DAO.Recordset
    
        On Error GoTo Err_RP_Click
    
        DoCmd.OpenForm "FrmRecomPaiement"
    ...
    See more | Go to post

    Leave a comment:


  • I actually tried the code you gave me in post #12, but it did not work and that is why I tried what I have right now. As you can see, line 7 is the code you gave me in post 12 (with the exception that DateRecomPaiem is DateRecom, that was a mistake on my part when I told you the name of my fields. The actual name is DateRecom). What I'm trying to do is on the click of a button in one form (FrmFacture) either open a new record in a form that contains...
    See more | Go to post

    Leave a comment:


  • Ok, I'll try to explain my problem a little better this time. First of all, I found out that my code had a little bug, because in the case a NoFacture is already entered for a certain NoRecomPaiem it would not a the new NoFacture related to the same NoRecomPaiem (it would only open the record since the NoRecomPaiem already exists). This code is on line 12 to 34(It does not work completely right now, but lets do one problem at a time). Ok So my problem...
    See more | Go to post

    Leave a comment:


  • Ok I have Fixed a few problems with your help. However, the DateRecom does not transfer into the FrmRecomPaiemen t form and if I use your defaultvalue line for the NoRecomPaiem it doesn't work either. When I leave it like it was, it works, but the DateRecom still does not work. So here is what I have :
    Code:
    Private Sub RP_Click()
    
    If IsNull(DLookup("NoRecomPaiem", "TblRecomPaiementDet", "[NoRecomPaiem]="
    ...
    See more | Go to post

    Leave a comment:


  • My code looks like this now :
    Code:
    Private Sub RP_Click()
    
    If DLookup("NoRecomPaiem", "TblRecomPaiementDet", "[NoRecomPaiem]=" & Me.NoRecomPaiem) Is Null Then
    
        DoCmd.OpenForm "FrmRecomPaiement", , , , acFormAdd
        Forms!FrmRecomPaiement!NoRecomPaiem = Me!NoRecomPaiem
        Forms!FrmRecomPaiement!DateRecom = Me!DateRecomPaiem
        Forms!FrmRecomPaiement!NoFacture
    ...
    See more | Go to post

    Leave a comment:


  • Ok I think we're getting some where. The previous error is now gone, but now when I click the button another error message pops up :

    Error '424':
    Object required (The english version should look something like this I think)

    The error is still in line 3. I don't have a clue what this error could mean.
    See more | Go to post

    Leave a comment:


  • I barely changed the code. Like I said, I just changed the name of NoRecom to NoRecomPaiem like the other. This is what it gives :
    Code:
    Private Sub RP_Click()
    
    If DLookup("NoRecomPaiem", "TblRecomPaiementDet", "TblRecomPaiementDet.NoRecomPaiem='" & Me.NoRecomPaiem & "'") Is Null Then
    
        DoCmd.OpenForm "FrmRecomPaiement", , , , acFormAdd
        Forms!FrmRecomPaiement!NoRecomPaiem
    ...
    See more | Go to post

    Leave a comment:


  • I'm not sure I fully understand what you said in your first post. If i set it as a default value, how will it know when to open the form to an old record that already has that number or when to open a new record and automatically write the information I already entered (RecomPaiem, NoFacture and DateRecom)?

    Also, I don't know if the code I entered in my first post is wrong (I tried it with things I found on google), but it says that...
    See more | Go to post

    Leave a comment:


  • I tried to simplify it without all the names and stuff, but if it didn't help, the number # is equivalent to NoRecom (it is called NoRecomPaiem in some forms and tables). The table A is TblFacture and table B is TblRecomPaiemen t. For the forms, form A is FrmFacture and form B is FrmRecomPaiemen t.
    See more | Go to post

    Leave a comment:


  • David Desormeau
    started a topic VBA code to look in table and open form

    VBA code to look in table and open form

    Hi everyone,

    I have another question for you all. I have a form A in which I enter a number # and this number is stored in a table 1. In this same form A, I want to add a button. When I click this button I want it to look in a table 2 to see if the number # I entered is already there. If it is not there, I want form B to open and have the number # already in the field associated to it so I only have to fill in the rest. However, if...
    See more | Go to post
    Last edited by David Desormeau; Aug 4 '11, 07:55 PM. Reason: What I have now.

  • David Desormeau
    started a topic Can you modifiy the text in a dialog box?

    Can you modifiy the text in a dialog box?

    Hi guys, you've all helped me so much with my last question and now I have a new one for you. I have a form with a bunch of buttons in it that lead to different reports. When I click on one of the buttons a dialog box opens and says :

    This code can be found here in the macro window for the button :

    Is there any way to easily change the text in the dialog box because I know that you just need to enter the contract...
    See more | Go to post

  • David Desormeau
    replied to Help with a where condition
    Ok. What I'm trying to achieve is that when I click on a button in a form I made called FrmMenu (there are only buttons in this form. No data entry) I want it to ask the user what lot number he wants. Then with that number, it finds all the contracts from the table and displays only the ones ending with the lot number specified (because the contracts have the form XX-X-XXX and the last 3 X are the lot number). I also want to have the lot number the...
    See more | Go to post

    Leave a comment:


  • David Desormeau
    replied to Help with a where condition
    I tried your code and the problem is with the Me.Lot. Lot is not in any of the tables I made and it is not it the form either. I used a text box in the report and named it Lot. When I try to open the report, it asks me which Lot number I want. How do I make the code work in this case?
    See more | Go to post

    Leave a comment:


  • David Desormeau
    replied to Help with a where condition
    Ok, I'm guessing this must be in the Visual Basic code so I remved it from the where and wrote this in the onClick event of the button : However, an error message pops up (error 2465) and it does not seem to work. Am I doing something wrong? The [Lot] is not in any tables. I just added it in the report so it asks which value I want when I open it and displays it on the report. Could this be the probem? I really appreciate your help by the way....
    See more | Go to post

    Leave a comment:


  • David Desormeau
    replied to Help with a where condition
    I put the condition in the macro window (see image). Of course I'm french so the window might seem a little different than yours because of the text but the code I entered is what I wrote in my first post. For my other buttons (the ones that work) I wrote: [TableDeficience s]![Contrat]=[Forms]![FormulaireDefic iences]![Contrat]![Reports]![PetitRapport]![Étiquette27]

    This then asks me what contract I want from my table and from the form...
    See more | Go to post

    Leave a comment:


  • David Desormeau
    started a topic Help with a where condition

    Help with a where condition

    Hi everyone,

    I need help with a database i'm working on. It is almost fully fonctionnal. I have a form that is a menu and this form contains command buttons. Most of them work, but I cannot get one to do what I want. I need to be able to click on the button and when I do it ask me a number (3 or 4 characters). It then displays a report with the contract numbers ending with this number I just entered. I tried entering a where condition...
    See more | Go to post
    Last edited by David Desormeau; Jul 13 '11, 08:38 PM. Reason: More information.
No activity results to display
Show More
Working...