Opeing a form to enter new data only. (1 Viewer)

LOUISBUHAGIAR54

Registered User.
Local time
Yesterday, 23:52
Joined
Mar 14, 2010
Messages
157
I have been having problems with opening a form to add new records only. I have gone through all possible solutions but somehow the problem persists.

I want to add new records only and not view any of the existing records. I have set the form properties to Date Entry Yes, Allow additions to Yes, Allow Edits to No.

The form opens through a command button on another form and the vba code is the following.

DoCmd.OpenForm "FormInvDetails", acNormal, , , , acDialog

What am I doing wrong.

Louis Buhagiar
 

bob fitz

AWF VIP
Local time
Today, 07:52
Joined
May 23, 2011
Messages
4,727
Try:
DoCmd.OpenForm "FormInvDetails", acNormal, acFormAdd
 

LOUISBUHAGIAR54

Registered User.
Local time
Yesterday, 23:52
Joined
Mar 14, 2010
Messages
157
Tried that. Still no joy. Could there be something over-riding the settings ?

Many thanks.

LOUIS BUHAGIAR
 

LOUISBUHAGIAR54

Registered User.
Local time
Yesterday, 23:52
Joined
Mar 14, 2010
Messages
157
Tried that. Still no joy. Could there be something over-riding the settings ?

Many thanks.

LOUIS BUHAGIAR
 

LOUISBUHAGIAR54

Registered User.
Local time
Yesterday, 23:52
Joined
Mar 14, 2010
Messages
157
No error messages. When the form opens it still contains previous records. I want it to display a form ready to receive new data in its fields.

Louis Buhagiar.
 

bob fitz

AWF VIP
Local time
Today, 07:52
Joined
May 23, 2011
Messages
4,727
Can you post a copy of the db for us to examine.
 

LOUISBUHAGIAR54

Registered User.
Local time
Yesterday, 23:52
Joined
Mar 14, 2010
Messages
157
Sorry for the delay. Can u please direct me on how to send you the database ?
 

LOUISBUHAGIAR54

Registered User.
Local time
Yesterday, 23:52
Joined
Mar 14, 2010
Messages
157
Good Morning. Many thanks for your assistance.

I will try to post you the db with this post as you advised. I hope I can attach it well. The db is split and has the fe and the be sections.

The command button I was talking about that introduces the form which is not behaving well is on form TruCompanies and is named "Enter New Invoice". In order for this button's command to function Combo7 on the same form has to be populated by a choice.

The form FormInvDetails is not opening well as required. I want it to open and take new invoices. This form is not working well despite its settings.

Another form [Enter Company Details] opens to take new data and I want FormInvDetails to open in a similar manner. There is no problem with form [Enter Company Details].

The top textbox on form FormInvDetails is contains linked data.

In addition when one tries to enter into form TruCompany one encounters a message "Data type mismatch in criteria expression". I do not know yet why this is but I am not concentrating on this yet. I have been trying to populate the list box in TruCompany using a vba command initiated by AfterUpdate procedure on option group called Frame31. I hope you may be able to help with this as well. I have done similar things before and they worked. Must be a something I am overlooking.

I hope I can attach the db and that you will receive it well.

Note I have tried to send you the fe but it is over the 2MB allowed. It is 4.18MB. Is there another way to post it to you ?

Louis Buhagiar
 

Attachments

  • DSuppliers_be.accdb
    892 KB · Views: 61

bob fitz

AWF VIP
Local time
Today, 07:52
Joined
May 23, 2011
Messages
4,727
I have the be db. To reduce the size of the fe file you should do Compact and Repair, then zip it and attach the zip file.
 

LOUISBUHAGIAR54

Registered User.
Local time
Yesterday, 23:52
Joined
Mar 14, 2010
Messages
157
Forgive me for being your nuisance for the day. How do I zip the file?

Louis
 

LOUISBUHAGIAR54

Registered User.
Local time
Yesterday, 23:52
Joined
Mar 14, 2010
Messages
157
I managed to compress it. Here goes..
 

Attachments

  • DSuppliers.zip
    1.3 MB · Views: 80

LOUISBUHAGIAR54

Registered User.
Local time
Yesterday, 23:52
Joined
Mar 14, 2010
Messages
157
Hi Bob,

Can you please confirm that you have received the files ?


Louis Buhagiar
 

bob fitz

AWF VIP
Local time
Today, 07:52
Joined
May 23, 2011
Messages
4,727
You have a problem with the query "Due" that is used as the Row Source of the list box "List15". I suspect there is a problem with the criteria reference to Combo15. There may be other criteria problems. Solve those and the form will open as it should.
 

LOUISBUHAGIAR54

Registered User.
Local time
Yesterday, 23:52
Joined
Mar 14, 2010
Messages
157
Hi Bob, Good Day,


I have found out what the problem was with that form not opening to add new records only despite the setting. Hurrah.

The problem was with the query attached to that form. I re-arranged the query and excluded its relationship with table "CompDetails" and the form is opening as required. Obviously you cannot have a relationship when the relating fields are not yet established so the query cannot be formed. Anyway my form is in receiving shape now. Thanks anyway.

Maybe since you have the database you may now wish to help out with why List15 is not receiving the query by vba.

Many thanks for your observations which you make need to point out to me.


Louis Buhagiar
 

gsrajan

Registered User.
Local time
Today, 02:52
Joined
Apr 22, 2014
Messages
227
Normally I open the form with record source as query with all the fields - with a where condition query which retrieves no records from the table ( example: WHERE [CUSTOMERNAME]="YUGJHG") - May be I am wrong!
 

LOUISBUHAGIAR54

Registered User.
Local time
Yesterday, 23:52
Joined
Mar 14, 2010
Messages
157
Hi..

Can someone please explain why after sending my database online this thread appears to have gone dead ?

Does this happen often on this site ? What could be the reason ?


Louis Buhagiar.
 

Users who are viewing this thread

Top Bottom