Re: Creating a key on the Input form



Not sure I understand your issue as your thread doesn't define it at
the outset. However, I believe your problem would be solved by
including BOTH fields in the Primary Key OR by using an Autonumber for
the Primary Key.

HTH
--
-Larry-
--

"SharonInGa" <SharonInGa@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:BAD32875-509F-41A1-8E6E-C41DA146BEA8@xxxxxxxxxxxxxxxx
> The selection of one of these fields creates the key field. This
field
> inputs into a table with a mahy to many relationship. A customer
may have a
> PO# or a BOL# or both. A PO# takes priority over a BOL#. The
process works
> great if you are in the record only once. However, an error message
appears
> saying that there is a problem with the field relationship if you go
back
> into the record for whatever reason. What event should this code go
in or
> what can I do differently?
>
> fieldOne, fieldTwo, BOL#, POL#, (Invisible) KeyField
>
>
> Private Sub PO__LostFocus()
> If Me.BOL_ > 1 Then
> Me.MerchandisePO_ = Me.BOL_
> Else
> End If
>
> If Me.PO_ > 1 Then
> Me.MerchandisePO_ = Me.PO_
> End If
>
> End Sub
>


.



Relevant Pages

  • Re: Stored procs and DB-aware components possible at all?
    ... a primary key but it just wouldn't work. ... Performance became dreadfully slow if the database ... documented in BOL, BTW). ... So I had to give up on INNER JOIN. ...
    (borland.public.delphi.database.ado)
  • Re: A real learners question!
    ... the before update event of the form? ... In the property dialog, when in the Before Update line, hit the button ... private sub form_beforeupdate ... Another question - just to be sure you do use a composite primary key ...
    (microsoft.public.access.forms)
  • Re: Printing Single Record
    ... The use the primary key value of the ... >Private Sub cmdPrintRecord_Click ... rather than allenbrowne at mvps dot org. ... >> single record when requested. ...
    (microsoft.public.access.reports)
  • RE: Open a form with a filter based on dependent data
    ... and I am prompted in a window called "Enter parameter ... data_entry's primary key is known as "ID", and has a bunch of other fields. ... Private Sub Command200_Click'This is the relations button ... Dim holdval As String ...
    (microsoft.public.access.forms)
  • Re: BeforeUpdate event issue
    ... The primary key cannot be a duplicate. ... Private Sub Form_BeforeUpdate ... Response As Integer) ... MsgBox "You have entered a File Code that already exists in the ...
    (microsoft.public.access.forms)