UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> opening a new form, and adding data    
 
   
Powelldog
post Feb 17 2007, 06:02 PM
Post #1

UtterAccess Veteran
Posts: 394
From: Colorado



I am trying to fix up some problems in my database.

I used to have a form that used a Customer Query to look up a customer
then when I pushed a button:
a new form would open a Diagnostic Query "Form" and display the Data marked as "open"

Now when I open the same form, and attmept to add data None of the imformation (like the name of the person) or any other imformation is opened as a new form, I can only "see already open forms"

CODE

       stLinkCriteria = "[CustomerTable.VehicleId]" = Me![VehicleId]
       DoCmd.OpenFrom StDocName, , , stLinkCriteria


The VehicleId is a One to many Relationship, From the Customer Table to the Diagnostic Table
David
Go to the top of the page
 
+
Powelldog
post Feb 18 2007, 01:14 AM
Post #2

UtterAccess Veteran
Posts: 394
From: Colorado



Here is more of the code in question
the query is based on 3 tables

OwnerTable:
OwnerId, Key,Autonumber
OwnerName

CustomerTable:
VehicleId, Key, Autonumber
OwnerId
year
make
model...

DiagnosticTable:
DiagnsoticId, key, Autonumber
VehicleId
ROnumber
TicketOpenClosed Yes/No

the query shows only the TicketOpenClosed if it is set to "yes"

I can't get the string link to open a new record, or even go to a record if there is already one there




CODE
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
    Dim stDocName As String
    Dim stLinkCriteria As String
    
    If Me.Year > 1980 And Me.YearCheck = 0 Then
        If MsgBox("The Year of the vehicle and the Vin Number Year do not match!" & vbCrLf & _
              "Do you want to correct it?", vbQuestion + vbYesNo, "Mismatch") = vbYes Then
       Me.Year.SetFocus
       Exit Sub
       End If
    End If

    
    stDocName = "OpenDiagnosticsQuery"
    
  
  
  
    stLinkCriteria = "[CustomerTable.VehicleId]=" & Me![VehicleId]
    DoCmd.OpenForm stDocName, , , stLinkCriteria
Go to the top of the page
 
+

Thank you for your support! Reply to this topicStart new topic

Jump To Forum:
 



RSS Go to Top  ·  Lo-Fi Version Time is now: 22nd May 2013 - 10:58 AM