Bug 1 mdb With Tab Control works fine. Bugs with mde

A

Avid Fan

Me.RecordsetClone.FindFirst "[ID] = " & Me![LstDoctor]
Me.Bookmark = Me.RecordsetClone.Bookmark

This code does not seem to work in the MDE

Me.LstDoctor.value should be the ID value
 
J

Jeanette Cunningham

Rewrite the code slightly like this:

With Me.RecordsetClone
.FindFirst "[ID] = " & Me![LstDoctor]
If Not .NoMatch Then
Me.Bookmark = .Bookmark
End If
End With

Including the .NoMatch test is always a good idea when using FindFirst


Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
 
A

Avid Fan

Rewrite the code slightly like this:

Access 2007 creating a 2003 version


Actually I need something like this when I delete my test data and hand
over a empty data table I needed something that would not give me an
error when table was empty . I had something but your code is much more
elegant - thanks.

The code works fine with the MDB, However it does not fix my problem
with the MDE.

I have a Tab Control and first page of the Tab control has a large list
control with a search function.

The user finds the Customer, clicking on the next tab gives the customer
record for editing in the MDB but in the MDE instead of providing
selected customer from the Listbox it gives the first record ever entered.

I am finding that there are a number of MDE errors.

This does not even work.

Private Sub cmdCopyAddress_Click()
Me.Address2.Value = Me.Address1.Value
Me.cboSuburb2.Value = Me.cboSuburb1.Value
Me.State2.Value = Me.State1.Value
Me.PostCode2.Value = Me.PostCode1.Value
End Sub



With Me.RecordsetClone
.FindFirst "[ID] = "& Me![LstDoctor]
If Not .NoMatch Then
Me.Bookmark = .Bookmark
End If
End With

Including the .NoMatch test is always a good idea when using FindFirst


Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia


Avid Fan said:
Me.RecordsetClone.FindFirst "[ID] = "& Me![LstDoctor]
Me.Bookmark = Me.RecordsetClone.Bookmark

This code does not seem to work in the MDE

Me.LstDoctor.value should be the ID value
 
J

Jeanette Cunningham

How have you setup the form with the tab control?
What table or tables is it based on?
Which pages of the tab control have subforms on them?

Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia


Avid Fan said:
Rewrite the code slightly like this:

Access 2007 creating a 2003 version


Actually I need something like this when I delete my test data and hand
over a empty data table I needed something that would not give me an error
when table was empty . I had something but your code is much more
elegant - thanks.

The code works fine with the MDB, However it does not fix my problem with
the MDE.

I have a Tab Control and first page of the Tab control has a large list
control with a search function.

The user finds the Customer, clicking on the next tab gives the customer
record for editing in the MDB but in the MDE instead of providing selected
customer from the Listbox it gives the first record ever entered.

I am finding that there are a number of MDE errors.

This does not even work.

Private Sub cmdCopyAddress_Click()
Me.Address2.Value = Me.Address1.Value
Me.cboSuburb2.Value = Me.cboSuburb1.Value
Me.State2.Value = Me.State1.Value
Me.PostCode2.Value = Me.PostCode1.Value
End Sub



With Me.RecordsetClone
.FindFirst "[ID] = "& Me![LstDoctor]
If Not .NoMatch Then
Me.Bookmark = .Bookmark
End If
End With

Including the .NoMatch test is always a good idea when using FindFirst


Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia


Avid Fan said:
Me.RecordsetClone.FindFirst "[ID] = "& Me![LstDoctor]
Me.Bookmark = Me.RecordsetClone.Bookmark

This code does not seem to work in the MDE

Me.LstDoctor.value should be the ID value
 
A

Avid Fan

How have you setup the form with the tab control?
The first thing after the creation the form was to add the tab control,
before I added the data.

What table or tables is it based on?

The table tblCustomer nothing special. In the mdb moving the cursor in
the listbox changes the record. In the mde nothing happens.

Which pages of the tab control have subforms on them?

Pages 3,4,5,6

3 is linked tblCallNotes and works, however, it is shown with my first
Customer record.

SELECT tblCallNotes.[ID], tblCallNotes.[Customer_ID],
tblCallNotes.[CallType], tblCallNotes.[CallDate], tblCallNotes.[CallNotes]
FROM tblCallNotes
ORDER BY tblCallNotes.[CallDate] DESC;

4 DOES NOT work it based on this on parameter query

SELECT tblCustomer.Suburb1, tblCallNotes.CallDate,
tblCallNotes.CallType, Trim(tblCustomer.Title)+'
'+Trim(tblCustomer.First_Name)+' '+Trim(tblCustomer.Last_Name) AS
Cust_Name, tblCustomer.Target, tblCallNotes.CallNotes,
tblCallNotes.Customer_ID
FROM tblCustomer INNER JOIN tblCallNotes ON tblCustomer.ID =
tblCallNotes.Customer_ID
WHERE tblCallNotes.CallDate BETWEEN
Forms!frmCustomer!frmCallPlanner!txtdate1 AND
Forms!frmCustomer!frmCallPlanner!txtdate2
ORDER BY tblCallNotes.CallDate, tblCustomer.Target, tblCustomer.Suburb1;

5
6
Work.
Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
Avid Fan said:
Rewrite the code slightly like this:

Access 2007 creating a 2003 version


Actually I need something like this when I delete my test data and hand
over a empty data table I needed something that would not give me an error
when table was empty . I had something but your code is much more
elegant - thanks.

The code works fine with the MDB, However it does not fix my problem with
the MDE.

I have a Tab Control and first page of the Tab control has a large list
control with a search function.

The user finds the Customer, clicking on the next tab gives the customer
record for editing in the MDB but in the MDE instead of providing selected
customer from the Listbox it gives the first record ever entered.

I am finding that there are a number of MDE errors.

This does not even work.

Private Sub cmdCopyAddress_Click()
Me.Address2.Value = Me.Address1.Value
Me.cboSuburb2.Value = Me.cboSuburb1.Value
Me.State2.Value = Me.State1.Value
Me.PostCode2.Value = Me.PostCode1.Value
End Sub



With Me.RecordsetClone
.FindFirst "[ID] = "& Me![LstDoctor]
If Not .NoMatch Then
Me.Bookmark = .Bookmark
End If
End With

Including the .NoMatch test is always a good idea when using FindFirst


Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia


Me.RecordsetClone.FindFirst "[ID] = "& Me![LstDoctor]
Me.Bookmark = Me.RecordsetClone.Bookmark

This code does not seem to work in the MDE

Me.LstDoctor.value should be the ID value
 
J

Jeanette Cunningham

For the subform no. 3, you will need the link master and link child fields
set up correctly so that the subform automatically keeps in sync with the
customer chosen on the main form.
I am assuming that the link master field will be Customer_ID and the link
child field will be Customer_ID.


Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia



Avid Fan said:
How have you setup the form with the tab control?
The first thing after the creation the form was to add the tab control,
before I added the data.

What table or tables is it based on?

The table tblCustomer nothing special. In the mdb moving the cursor in
the listbox changes the record. In the mde nothing happens.

Which pages of the tab control have subforms on them?

Pages 3,4,5,6

3 is linked tblCallNotes and works, however, it is shown with my first
Customer record.

SELECT tblCallNotes.[ID], tblCallNotes.[Customer_ID],
tblCallNotes.[CallType], tblCallNotes.[CallDate], tblCallNotes.[CallNotes]
FROM tblCallNotes
ORDER BY tblCallNotes.[CallDate] DESC;

4 DOES NOT work it based on this on parameter query

SELECT tblCustomer.Suburb1, tblCallNotes.CallDate, tblCallNotes.CallType,
Trim(tblCustomer.Title)+' '+Trim(tblCustomer.First_Name)+'
'+Trim(tblCustomer.Last_Name) AS Cust_Name, tblCustomer.Target,
tblCallNotes.CallNotes, tblCallNotes.Customer_ID
FROM tblCustomer INNER JOIN tblCallNotes ON tblCustomer.ID =
tblCallNotes.Customer_ID
WHERE tblCallNotes.CallDate BETWEEN
Forms!frmCustomer!frmCallPlanner!txtdate1 AND
Forms!frmCustomer!frmCallPlanner!txtdate2
ORDER BY tblCallNotes.CallDate, tblCustomer.Target, tblCustomer.Suburb1;

5
6
Work.
Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
Avid Fan said:
On 11/04/2010 2:36 PM, Jeanette Cunningham wrote:
Rewrite the code slightly like this:

Access 2007 creating a 2003 version


Actually I need something like this when I delete my test data and hand
over a empty data table I needed something that would not give me an
error
when table was empty . I had something but your code is much more
elegant - thanks.

The code works fine with the MDB, However it does not fix my problem
with
the MDE.

I have a Tab Control and first page of the Tab control has a large list
control with a search function.

The user finds the Customer, clicking on the next tab gives the customer
record for editing in the MDB but in the MDE instead of providing
selected
customer from the Listbox it gives the first record ever entered.

I am finding that there are a number of MDE errors.

This does not even work.

Private Sub cmdCopyAddress_Click()
Me.Address2.Value = Me.Address1.Value
Me.cboSuburb2.Value = Me.cboSuburb1.Value
Me.State2.Value = Me.State1.Value
Me.PostCode2.Value = Me.PostCode1.Value
End Sub





With Me.RecordsetClone
.FindFirst "[ID] = "& Me![LstDoctor]
If Not .NoMatch Then
Me.Bookmark = .Bookmark
End If
End With

Including the .NoMatch test is always a good idea when using FindFirst


Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia


Me.RecordsetClone.FindFirst "[ID] = "& Me![LstDoctor]
Me.Bookmark = Me.RecordsetClone.Bookmark

This code does not seem to work in the MDE

Me.LstDoctor.value should be the ID value
 
A

Avid Fan

On 12/04/2010 6:44 AM, Jeanette Cunningham wrote:
Subform 3 appears to be working correctly the problem is that because
Page 1 of my tab control

Me.RecordsetClone.FindFirst "[ID] = "& Me![LstDoctor]

Does not appear to work in my MDE (works fine in My MDB)

As movement on the listbox does not change the selected customer the
first customer is always selected.

Is there an alternative to the

Me.RecordsetClone.FindFirst "[ID] = "& Me![LstDoctor]

Code?

Is anyone else having these sorts of problems with MDEs?
For the subform no. 3, you will need the link master and link child
fields set up correctly so that the subform automatically keeps in
sync with the customer chosen on the main form. I am assuming that
the link master field will be Customer_ID and the link child field
will be Customer_ID.


Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia



Avid Fan said:
How have you setup the form with the tab control?
The first thing after the creation the form was to add the tab
control, before I added the data.

What table or tables is it based on?

The table tblCustomer nothing special. In the mdb moving the
cursor in the listbox changes the record. In the mde nothing
happens.

Which pages of the tab control have subforms on them?

Pages 3,4,5,6

3 is linked tblCallNotes and works, however, it is shown with my
first Customer record.

SELECT tblCallNotes.[ID], tblCallNotes.[Customer_ID],
tblCallNotes.[CallType], tblCallNotes.[CallDate],
tblCallNotes.[CallNotes] FROM tblCallNotes ORDER BY
tblCallNotes.[CallDate] DESC;

4 DOES NOT work it based on this on parameter query

SELECT tblCustomer.Suburb1, tblCallNotes.CallDate,
tblCallNotes.CallType, Trim(tblCustomer.Title)+'
'+Trim(tblCustomer.First_Name)+' '+Trim(tblCustomer.Last_Name) AS
Cust_Name, tblCustomer.Target, tblCallNotes.CallNotes,
tblCallNotes.Customer_ID FROM tblCustomer INNER JOIN tblCallNotes
ON tblCustomer.ID = tblCallNotes.Customer_ID WHERE
tblCallNotes.CallDate BETWEEN
Forms!frmCustomer!frmCallPlanner!txtdate1 AND
Forms!frmCustomer!frmCallPlanner!txtdate2 ORDER BY
tblCallNotes.CallDate, tblCustomer.Target, tblCustomer.Suburb1;

5 6 Work.
Jeanette Cunningham MS Access MVP -- Melbourne Victoria
Australia
On 11/04/2010 2:36 PM, Jeanette Cunningham wrote:
Rewrite the code slightly like this:

Access 2007 creating a 2003 version


Actually I need something like this when I delete my test data
and hand over a empty data table I needed something that would
not give me an error when table was empty . I had something but
your code is much more elegant - thanks.

The code works fine with the MDB, However it does not fix my
problem with the MDE.

I have a Tab Control and first page of the Tab control has a
large list control with a search function.

The user finds the Customer, clicking on the next tab gives the
customer record for editing in the MDB but in the MDE instead
of providing selected customer from the Listbox it gives the
first record ever entered.

I am finding that there are a number of MDE errors.

This does not even work.

Private Sub cmdCopyAddress_Click() Me.Address2.Value =
Me.Address1.Value Me.cboSuburb2.Value = Me.cboSuburb1.Value
Me.State2.Value = Me.State1.Value Me.PostCode2.Value =
Me.PostCode1.Value End Sub





With Me.RecordsetClone .FindFirst "[ID] = "&
Me![LstDoctor] If Not .NoMatch Then Me.Bookmark = .Bookmark
End If End With

Including the .NoMatch test is always a good idea when using
FindFirst


Jeanette Cunningham MS Access MVP -- Melbourne Victoria
Australia


Me.RecordsetClone.FindFirst "[ID] = "& Me![LstDoctor]
Me.Bookmark = Me.RecordsetClone.Bookmark

This code does not seem to work in the MDE

Me.LstDoctor.value should be the ID value
 
J

Jeanette Cunningham

I thought that the listbox was working correctly.
The FindFirst code will work in an mde or an mdb - no difference.

Have a look at the code called 'Using a combo box to find records'.
http://allenbrowne.com/ser-03.html

The code works for a listbox in single select mode in just the same way as
for a combo.
It may help you to set up your code so that it works in this situation.


Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia


Avid Fan said:
On 12/04/2010 6:44 AM, Jeanette Cunningham wrote:
Subform 3 appears to be working correctly the problem is that because Page
1 of my tab control

Me.RecordsetClone.FindFirst "[ID] = "& Me![LstDoctor]

Does not appear to work in my MDE (works fine in My MDB)

As movement on the listbox does not change the selected customer the first
customer is always selected.

Is there an alternative to the

Me.RecordsetClone.FindFirst "[ID] = "& Me![LstDoctor]

Code?

Is anyone else having these sorts of problems with MDEs?
For the subform no. 3, you will need the link master and link child
fields set up correctly so that the subform automatically keeps in
sync with the customer chosen on the main form. I am assuming that
the link master field will be Customer_ID and the link child field
will be Customer_ID.


Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia



Avid Fan said:
On 11/04/2010 5:53 PM, Jeanette Cunningham wrote:
How have you setup the form with the tab control?
The first thing after the creation the form was to add the tab
control, before I added the data.


What table or tables is it based on?

The table tblCustomer nothing special. In the mdb moving the
cursor in the listbox changes the record. In the mde nothing
happens.


Which pages of the tab control have subforms on them?

Pages 3,4,5,6

3 is linked tblCallNotes and works, however, it is shown with my
first Customer record.

SELECT tblCallNotes.[ID], tblCallNotes.[Customer_ID],
tblCallNotes.[CallType], tblCallNotes.[CallDate],
tblCallNotes.[CallNotes] FROM tblCallNotes ORDER BY
tblCallNotes.[CallDate] DESC;

4 DOES NOT work it based on this on parameter query

SELECT tblCustomer.Suburb1, tblCallNotes.CallDate,
tblCallNotes.CallType, Trim(tblCustomer.Title)+'
'+Trim(tblCustomer.First_Name)+' '+Trim(tblCustomer.Last_Name) AS
Cust_Name, tblCustomer.Target, tblCallNotes.CallNotes,
tblCallNotes.Customer_ID FROM tblCustomer INNER JOIN tblCallNotes
ON tblCustomer.ID = tblCallNotes.Customer_ID WHERE
tblCallNotes.CallDate BETWEEN
Forms!frmCustomer!frmCallPlanner!txtdate1 AND
Forms!frmCustomer!frmCallPlanner!txtdate2 ORDER BY
tblCallNotes.CallDate, tblCustomer.Target, tblCustomer.Suburb1;

5 6 Work.


Jeanette Cunningham MS Access MVP -- Melbourne Victoria
Australia



On 11/04/2010 2:36 PM, Jeanette Cunningham wrote:
Rewrite the code slightly like this:

Access 2007 creating a 2003 version


Actually I need something like this when I delete my test data
and hand over a empty data table I needed something that would
not give me an error when table was empty . I had something but
your code is much more elegant - thanks.

The code works fine with the MDB, However it does not fix my
problem with the MDE.

I have a Tab Control and first page of the Tab control has a
large list control with a search function.

The user finds the Customer, clicking on the next tab gives the
customer record for editing in the MDB but in the MDE instead
of providing selected customer from the Listbox it gives the
first record ever entered.

I am finding that there are a number of MDE errors.

This does not even work.

Private Sub cmdCopyAddress_Click() Me.Address2.Value =
Me.Address1.Value Me.cboSuburb2.Value = Me.cboSuburb1.Value
Me.State2.Value = Me.State1.Value Me.PostCode2.Value =
Me.PostCode1.Value End Sub





With Me.RecordsetClone .FindFirst "[ID] = "&
Me![LstDoctor] If Not .NoMatch Then Me.Bookmark = .Bookmark
End If End With

Including the .NoMatch test is always a good idea when using
FindFirst


Jeanette Cunningham MS Access MVP -- Melbourne Victoria
Australia


Me.RecordsetClone.FindFirst "[ID] = "& Me![LstDoctor]
Me.Bookmark = Me.RecordsetClone.Bookmark

This code does not seem to work in the MDE

Me.LstDoctor.value should be the ID value
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top