Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2002
    Location
    Hamilton,Ontario
    Posts
    132

    Unanswered: Opening Form with New Record

    hi Every one:
    Any one can help me with this ? i want to open this form with new record and display that record on the form.
    here is my Portion of Code.


    response = MsgBox("Item Number:" & " " & itemNo & " " & "Does Not Exist in Conversion Factor Table" & vbCrLf & "Would You Like To Add This Now ?", vbYesNo, "Add Item To Conversion Factor Table")
    If response = ID_YES Then
    'This is where I am having problem in opening that form.
    'Any Help Will Be Appreciated
    DoCmd.OpenForm "zConversion Factor", acNormal, , , , acNewRec
    Else
    Exit Function
    End If

  2. #2
    Join Date
    Dec 2002
    Posts
    60

    Re: Opening Form with New Record

    You might try adding:

    forms![zConversion Factor].DataEntry=true

    after the DoCmd.OpenForm.....

    (Or place me.dataentry=true in the form open event)

  3. #3
    Join Date
    Nov 2002
    Location
    Hamilton,Ontario
    Posts
    132

    Re: Opening Form with New Record

    Here is the Working Code

    SQLStmt = "Select * from [Inventory] where [Item Number]='" & RecipeitemNo & "'"
    Set adrs = curdb.OpenRecordset(SQLStmt, dbOpenDynaset)
    If adrs.EOF = False Then
    'Accessing Table [Inventory Recipes]
    SQLStmt = "Select * from [Inventory Recipes] where [FinishedProduct]='" & RecipeitemNo & "'"
    Set adrsAddRecipe = curdb.OpenRecordset(SQLStmt, dbOpenDynaset)
    'Checking if Item Exists
    If adrsAddRecipe.EOF = True Then
    DoCmd.OpenForm "zInventoryRecipes", acNormal
    If isloaded("zInventoryRecipes") Then
    Set openedForm = Forms![zInventoryRecipes].Form
    DoCmd.GoToRecord , , acNewRec
    With openedForm
    .FinishedProduct = RecipeitemNo
    End With
    End If
    End If
    End If

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •