Per impostare la proprietà enabled ad un controllo di una maschera se il
record corrente è l'ultimo faccio così
If Me![id_data_fattura] = DLast("[id_data_fattura]",
"T_fatture_carico_unione", "[id_data_fattura]=" &
[Forms]![M_carico_unione]![id_data_fattura]) Then
Me.recordprec.SetFocus
Me.recordsucc.Enabled = False
End If
ma la condizione in questo modo è sempre vera.
In un caso analogo invece non avevo avuto problemi.
Ci date un occhio e mi date un vostro parere ?
Grazie
ps il controllo recordprec riesiede su una form e all'interno ha una subform
associate entrambe a tabelle.
Forse mi perdo qualche pezzo.
La Form nella quale stai gestendo la navigazione ha un Recordset
esplorabile, perchè usi Dlast....?
Usa un controllo su RecordsetClone:
'Aggiorni per sicurezza il BookMark del RecordsetClone
Me.RecordsetClone.Bookmark = Me.Parent.Bookmark
'Per il CommandButton "Successivo"
Me.RecordsetClone.MoveNext
Me.recordsucc.Enabled=Not Me.RecordseClone.Eof
'Ripristini il BookMark dopo esserti mosso
Me.RecordsetClone.Bookmark = Me.Parent.Bookmark
'Per il CommandButton "Precedente"
Me.RecordsetClone.MovePrevious
Me.recordsucc.Enabled=Not Me.RecordseClone.Bof
'Ripristini il BookMark dopo esserti mosso
Me.RecordsetClone.Bookmark = Me.Parent.Bookmark
Ciao
--
@Alex (Alessandro Baraldi)
---------------------------------------------------------------------------
http://www.sitocomune.com/
http://www.mantuanet.it/alessandro.baraldi/
---------------------------------------------------------------------------
Ciao Alex,
grazie per la risposta. Mi segnale questo:
"riferimento alla proprietà parent non valido nell'espressione"
Ciao
Che versione di Access usi...?
Probabilmente non hai i riferimenti alle Librerie DAO.
Dalla modalitą Codice---Strumenti --->Riferimenti---Cerca e Flagga
"Microsoft DAO 3.6"
se non usi ADO (Microsoft Activex Data Object 2.8) deselezionalo.
Ciao
--
@Alex (Alessandro Baraldi)
****A2K i riferimenti sono ok, avevo controllato prima di postarti.
>
> Dalla modalità Codice---Strumenti --->Riferimenti---Cerca e Flagga
> "Microsoft DAO 3.6"
> se non usi ADO (Microsoft Activex Data Object 2.8) deselezionalo.
>
Il problema è che secondo me non ho ben recepito il primo tuo post :
Me.RecordsetClone.Bookmark = Me.Parent.Bookmark
Me.RecordsetClone.MoveNext
Me.recordsucc.Enabled = Not Me.RecordsetClone.EOF
Me.RecordsetClone.Bookmark = Me.Parent.Bookmark
DoCmd.GoToRecord , , acNext
questo nel commandbutton successivo
e questo nel command button precendete :
Me.RecordsetClone.Bookmark = Me.Parent.Bookmark
Me.RecordsetClone.MovePrevious
Me.recordsucc.Enabled = Not Me.RecordsetClone.BOF
Me.RecordsetClone.Bookmark = Me.Parent.Bookmark
DoCmd.GoToRecord , , acPrevious
Avevo fatto anche questa prova per intercettare l'utimo record, ma su
corrente la condizione è vera e non va bene
If Me.CurrentRecord = Me.RecordsetClone.RecordCount Then
MsgBox ("sono l'ultimo")
End If
Cosa non ho capito ??
Grazie.
Innanzitutto devi decidere di centralizzare la gestione dei Pulsanti di
Navigazione.
Il controllo di posizione dovrebbe essere gestito su Evento Current.
Nell'Evento chiami una Function che analizza la posizione e ne condiziona
i CommandButton
Ovviamente dato che muovendo il RecordsetClone in EOF ed in BOF devi
inseriere
la gestione Errori On Error Resume next altrimenti si pianta...!
Io ad esempio la gestisco in questo modo:
Private Sub Form_Current()
EnableDisableButtons
End Sub
Public Sub EnableDisableButtons()
' Check and see which Buttons should be enabled/disabled
' based on the current row of the recordset.
Dim RecNum As Long
On Error Resume Next
' Update our Nav info
Me.txtPos.value = Me.CurrentRecord
' If lblNumRecords is blank then this is the
' first time through and the recordset pointers
' may not be updated yet. We need to allow time
' for them to get updated.
If Me.lblNumRecords.Caption = "" Then
Me.RecordsetClone.MoveLast
DoEvents
End If
RecNum = Me.RecordsetClone.RecordCount
Me.lblNumRecords.Caption = " di " & RecNum & strFilter
' Are we on a NEW record
If Me.NewRecord = True Then
' Update our nav info.
'Me.txtPos.Value = "New Record"
Me.txtPos.value = Me.Parent.RecordsetClone.RecordCount + 1
Me.lblNumRecords.Caption = " di " &
Me.Parent.RecordsetClone.RecordCount + 1 & strFilter
Me.txtHidden.SetFocus
Me.cmdNext.Enabled = False
Me.cmdPrevious.Enabled = True
Me.cmdNew.Enabled = False
Exit Sub
End If
'If we reach here, we know we are not in a new record
'so we can enable the <New> button
'But we need to check if there are no records. If so,
'we disable all buttons except for the <New> button.
Me.cmdPrevious.Enabled = True
Me.cmdNext.Enabled = True
If MeRecordsetClone.RecordCount = 0 Then
'Me.cmdFirst.Enabled = False
Me.cmdNext.Enabled = False
Me.cmdPrevious.Enabled = False
Me.cmdLast.Enabled = False
Else
'Synchronise the current pointer in the two recordsets
Me.RecordsetClone.Bookmark = Me.Bookmark
'If there are records, see if we are on the first record
'If so, we should disable the <First> and <Prev> buttons
With Me.RecordsetClone
.MovePrevious
If .BOF Then
Me.txtHidden.SetFocus
Me.cmdPrevious.Enabled = Not (.BOF)
Exit Sub
End If
.Bookmark = Me.Bookmark
.MoveNext
If .EOF Then
Me.txtHidden.SetFocus
Me.cmdNext.Enabled = Not (.EOF)
Exit Sub
End If
.Bookmark = Me.Bookmark
End With
End If
End Sub
Porta pazienza per eventuali erorri ma ho stralciato solo quello che
potrebbe
esserti utile da una Routine molto elaborata.
Io ho inserito una TextBox chiamata txtHidden per eliminare il problema del
Focus
l'ho impostata con dimensioni 0,0 per non vederla ma per poterla usare.
Se guardi il Codice c'è anche la gestione della TextBox "txtPos" per
indicare
il Record Corrente e l'Etichetta "lblNumRecords" per il Numero di Records.
Tieni presente anche la possibilità di Muoverti su un NEW record.
Quì è gestita anche quella.... errori di CUT/COPY a parte....!
ALEX!
Ah, però bella domanda che ho fatto. ok.
Io ho inserito una TextBox chiamata txtHidden per eliminare il problema del
> Focus
> l'ho impostata con dimensioni 0,0 per non vederla ma per poterla usare.
****ok
> Se guardi il Codice c'è anche la gestione della TextBox "txtPos" per
> indicare
> il Record Corrente e l'Etichetta "lblNumRecords" per il Numero di Records.
****ok
Ho messo la public sub in un modulo standard :
Ho questo problema:
Me.txtPos.Value = Me.CurrentRecord utilizzo non valido della parola chiave
me
e questo me lo segnala in rosso
Me.lblNumRecords.Caption = " di " & Me.Parent.RecordsetClone.RecordCount 1 &
strFilter
Ci dai ancora un occhio ?
In no version I have read was that ever part of Mary's
instructions. And Angleton, the man who the Truitts seem to side
with against Bradlee, supposedly went through them like an
archivist.
The Truitts' trust for and seeming loyalty to the Angletons is
particularly interesting. In Rosenbaum's 1976 piece, the
following passage appears:
The Truitts were still in Tokyo when they received word of
the towpath murder, and the responsibility for the diary was
communicated to their mutual friend James Angleton through
still uncertain channels.
With the quiet skill of a cardsharp, Rosenbaum avoids an
important detail. Namely, how the Truitts found out about Mary's
death in the middle of the night halfway around the world.
Someone must have either called or wired them. Why is this matter
never addressed in any version?
In a memo of a meeting Hoover had with RFK after this briefing,
Hoover wrote: "The Attorney General told me he wanted to advise
me of a situation in the Giancana case which had considerably
disturbed him" [emphasis added]. For his own part, Hoover wrote
of his talk about the matter with the AG:
I expressed great astonishment at this [the association] in
view of the bad reputation of Maheu and the horrible
judgment in using a man of Giancana's background for such a
project. The Attorney General shared the same views.
Kennedy had made it clear to the CIA that if they were to have
any more of these types of ideas about using these characters,
they would have to go through the Justice Department first, i.e.
him. But what RFK did not know is that, as the I. G. Report
states:
It should be noted that the briefing of Kennedy was
restricted to Phase One of th
Certainly its most odious language is: ". . . we recognize that our best
defense is a good offense. . ." In other words, the United States
government has publicly admitted in an official government document that
it is now prepared to wage offensive warfare against its chosen
adversaries around the world irrespective of the
To the same effect is the Sixth Principle of the Principles of
International Law Recognized in the Charter of the Nuremberg Tribunal
and in
I won't go into all the things that must be true for Hersh to be
correct. I will add that in the definitive book of the subject,
The Phoenix Program, My Lai is described as part of the
Colby/Shackley operation.
After My Lai, the New York Times assigned Hersh to the Watergate
beat. The paper was getting scooped by Woodward and Bernstein at
the Washington Post. For a "crack" reporter, Hersh did not
distinguish himself, especially in retrospect. He basically
followed in the footsteps of the Post. i.e. the whole complicated
mess was a Nixon operation; there was no real CIA involvement;
whatever Hunt and McCord did, no matter how wei
Behind all the sordid details of these articles there is a bigger
picture to be outlined. One of the main parts of it is the
increasing ascendancy of tabloid journalism into the major media
outlets, and with it, its concomitant attachment to the lives of
celebrities. More often than not, that translates into the
endless search for sleaze and scandal. This chain on the lives of
the Kennedys has been well described in these articles. The
overall tendency has become so prevalent that, as many have
noted, tabloid sales in the U.S. have d
> [cut]
> ALEX!
>
> Ah, perň bella domanda che ho fatto. ok.
> Io ho inserito una TextBox chiamata txtHidden per eliminare il problema del
> > Focus
> > l'ho impostata con dimensioni 0,0 per non vederla ma per poterla usare.
> ****ok
>
> > Se guardi il Codice c'č anche la gestione della TextBox "txtPos" per
> > indicare
> > il Record Corrente e l'Etichetta "lblNumRecords" per il Numero di Records.
> ****ok
> Ho messo la public sub in un modulo standard :
> Ho questo problema:
>
> Me.txtPos.Value = Me.CurrentRecord utilizzo non valido della parola chiave
> me
CurrentRecord č una TextBox, e precisamente quella che ho inserito
all'interno dei Pulsanti Precedente e Successivo.
> e questo me lo segnala in rosso
>
> Me.lblNumRecords.Caption = " di " & Me.Parent.RecordsetClone.RecordCount 1 &
> strFilter
Ovvio mi sono scordato di togliere il riferimento alla Form
Parent.
Come ti dicevo nel mio caso l'applicazione č decisamente diversa.
Prova cosě:
Me.lblNumRecords.Caption = " di " & Me.RecordsetClone.RecordCount
> Ci dai ancora un occhio ?
Ciao
@Alex
--
Posted via Mailgate.ORG Server - http://www.Mailgate.ORG
su current della form principale :
If Me.NewRecord Then
Me.data_fattura = Date + 1
numero_fattura = DMax("numero_fattura", "[T_fatture_carico_unione]",
"[tipo_contratto] = 2") + 1
Me.numero_fattura.SetFocus
Me.recordsucc.Enabled = False
DoCmd.RunCommand acCmdSaveRecord
' con un nuovo record assegno un nuovo numero fattura e la data fattura
incrementate di 1
End If
If Me.CurrentRecord = 1 Then
Me.numero_fattura.SetFocus
Me.recordprec.Enabled = False
Me.recordsucc.Enabled = True
' se il record corrente è il primo inabilito il click su bottone
indietro di 1
' e abilito il bottone avanti di uno spostando il focus su una txt
nascosta
Else
If Me.CurrentRecord = Me.RecordsetClone.RecordCount Then
DoCmd.RunCommand acCmdSaveRecord
Me.numero_fattura.SetFocus
Me.recordsucc.Enabled = False
Me.recordprec.Enabled = True
' se il record corrente è l'ultimo inabilito il click su bottone
avanti di 1
' e abilito il bottone indietro di uno spostando il focus su una txt
nascosta
Else
Me.recordprec.Enabled = True
Me.recordsucc.Enabled = True
' nel caso in cui il record corrente sia in posizione intermedia tra
il primo e l'ultimo
' abilito sia avanti di 1 che indietro di 1
End If
end If
DoCmd.RunCommand acCmdSaveRecord
End Sub
Questo è quanto sono riuscito ad elaborare in questo week-end anche grazie
all'aiuto, anzi, direi che il merito è tutto suo.
Sto parlando di Cinzia.
Non è per mancanza di fiducia nei tuoi confronti ,(anzi!!), ma il 3d con te
l'ho iniziato, quando dall'altra parte con lei ero arrivato fino questo
punto, ed era iniziato per un problema con un'istruzione SQL e poi ho
approfondito il discorso dei pulsanti.
Se vuoi dammi pure un parere !
Ciao, a presto.
Scherzi vero....!
Il rispetto per Cinzia è massimo, ed ovviamente ci sono molti modi
di sviluppare le stesse cose.
Sta di fatto che io non ho fatto altro che darti un pezzo del mio codice
cercando di calarlo alle tue esigenze.
Il fatto vero è che solo te sai bene cosa vuoi fare, pertanto credo che il
massimo
sia di prendere entrambi i consigli e fare in modo di risolvere il
problema....!
> Se vuoi dammi pure un parere !
In merito a cosa...?
Se è per il codice, mi auguro tu abbia risolto, non posso dirti da quì se
funziona
dovrei provarlo, ma a spanne la logica è corretta.
> Ciao, a presto.
Ciao anche a te.
@Alex