open form with no data

Hi,

I have a form on which i present al lot of data from a database.
On the form is a comobox which i use to select the right record en present 
the data of this record on the form.

When i open de form, de combobox is empty (which is good !) but the rest of 
the form is already filled with the data of a record in the database (which 
is not good). When i choose a record for the combobox, the form is filled 
with the data of that particular record (which is good).

So the only problem i have is on opening the form. Is it possible to open 
the form without it being filled with data of a certain record (so is see a 
blank form) ?

Help will be much appreciated!
Pierre 


0
Pierkes
5/30/2010 5:50:09 PM
access 16762 articles. 3 followers. Follow

11 Replies
957 Views

Similar Articles

[PageSpeed] 15

Am 30.05.2010 19:50, schrieb Pierkes:
> Hi,
>
> I have a form on which i present al lot of data from a database.
> On the form is a comobox which i use to select the right record en present
> the data of this record on the form.
>
> When i open de form, de combobox is empty (which is good !) but the rest of
> the form is already filled with the data of a record in the database (which
> is not good). When i choose a record for the combobox, the form is filled
> with the data of that particular record (which is good).
>
> So the only problem i have is on opening the form. Is it possible to open
> the form without it being filled with data of a certain record (so is see a
> blank form) ?
>
> Help will be much appreciated!
> Pierre
>
>
Hi,

you can try something like this. Create a record without any 
information. That means with no entries, except of one column. For 
example a 0 in a field with integer-values. When you open the Form, you 
will only see that 0 and nothing else. That is the most easy way to 
solve this problem, i guess.

Greetings, J�rn
0
ISO
5/30/2010 6:24:06 PM
Hi Pierre,

> So the only problem i have is on opening the form. Is it possible to open 
> the form without it being filled with data of a certain record (so is see a 
> blank form) ?

Yes. Simply add a WHERE 1=0 clause to the form's recordsource (saved query 
or SQL statement). You will need to reassign the form's recordsource in the 
AfterUpdate procedure for your combo box. I have an example that uses a main 
search form with a subform, but is is a bit more complex that simply using a 
combo box. But, it does reassign the recordsource for the subform with each 
query run. You might want to have a look, here:

   http://www.accessmvp.com/TWickerath/downloads/elements.zip

   http://www.accessmvp.com/TWickerath/downloads/Chap08QBF.zip

   http://www.seattleaccess.org/downloads.htm
   See the download "Query By Form"
   Tom Wickerath, February 12, 2008



Tom Wickerath
Microsoft Access MVP
http://www.accessmvp.com/TWickerath/
__________________________________________

"Pierkes" wrote:

> Hi,
> 
> I have a form on which i present al lot of data from a database.
> On the form is a comobox which i use to select the right record en present 
> the data of this record on the form.
> 
> When i open de form, de combobox is empty (which is good !) but the rest of 
> the form is already filled with the data of a record in the database (which 
> is not good). When i choose a record for the combobox, the form is filled 
> with the data of that particular record (which is good).
> 
> So the only problem i have is on opening the form. Is it possible to open 
> the form without it being filled with data of a certain record (so is see a 
> blank form) ?
> 
> Help will be much appreciated!
> Pierre
0
Utf
5/30/2010 6:46:01 PM
Hi Pierre,

Add code to the open event of the form that opens the form to a new record. 
Your form will then be blank. Then when you choose a record ftom the 
combobox, the form will display that record.

Steve
santus@penn.com



"Pierkes" <info@advisearch.nl> wrote in message 
news:4c02a554$0$15511$703f8584@news.kpn.nl...
> Hi,
>
> I have a form on which i present al lot of data from a database.
> On the form is a comobox which i use to select the right record en present 
> the data of this record on the form.
>
> When i open de form, de combobox is empty (which is good !) but the rest 
> of the form is already filled with the data of a record in the database 
> (which is not good). When i choose a record for the combobox, the form is 
> filled with the data of that particular record (which is good).
>
> So the only problem i have is on opening the form. Is it possible to open 
> the form without it being filled with data of a certain record (so is see 
> a blank form) ?
>
> Help will be much appreciated!
> Pierre
> 


0
Steve
5/30/2010 6:51:04 PM
Pierkes wrote:

> Hi,
> 
> I have a form on which i present al lot of data from a database.
> On the form is a comobox which i use to select the right record en present
> the data of this record on the form.
> 
> When i open de form, de combobox is empty (which is good !) but the rest
> of the form is already filled with the data of a record in the database
> (which is not good). When i choose a record for the combobox, the form is
> filled with the data of that particular record (which is good).
> 
> So the only problem i have is on opening the form. Is it possible to open
> the form without it being filled with data of a certain record (so is see
> a blank form) ?
> 
> Help will be much appreciated!

Just open the form with a WHERE argument that has no records returned.

DoCmd.OpenForm "FormName",,,"1 = 0"

If you are using the bookmark method to show records with your ComboBox 
change that to applying a filter for the desired record.  

No need to mess with DataEntry mode or change Recordsets.
0
Rick
5/30/2010 6:56:43 PM
No, Steve, the form will not display the record of interest. The reason is 
that the recordset contains no existing records. Try it out if you don't 
believe me.


Tom Wickerath
Microsoft Access MVP
http://www.accessmvp.com/TWickerath/
__________________________________________

"Steve" wrote:

> Hi Pierre,
> 
> Add code to the open event of the form that opens the form to a new record. 
> Your form will then be blank. Then when you choose a record ftom the 
> combobox, the form will display that record.
> 
> Steve
> santus@penn.com
0
Utf
5/30/2010 8:32:01 PM
Pierkes wrote:

> Hi Rick,
> 
> I tried to reply to the group earlier but didn't see it appearing so
> here's another go...
> 
> Thanks for your code, it works !
> 
> However, i do not use the DoCmd.OpenForm "FormName",,,"1 = 0" to open the
> form but instead, to get the form to open in a subform, i use ;
> 
> SubFormArea.SourceObject  = "Houses"
> 
> Any idea on how to adjest this code so it opens with a blank sheet ?
> Thanks in advance,

Well, that does change the parameters of the question quite a bit.  You 
could try...

SubFormArea.SourceObject  = "Houses"
SubFormArea.Form.Filter = "1 = 0"
SubFormArea.Form.FilterOn = True

....but I'm not sure if that would first "blink" on a record before the 
filter is applied.

If you are going to use a subform then you might be best to put the ComboBox 
in the main form and use the MasterLink and ChildLink properties to do the 
filtering.  In that case as long as the main form starts out with a ComboBox 
entry that has no match in the subform then you should get a blank subform 
until you change it.
0
Rick
5/30/2010 9:48:29 PM
On all of the database's that I have created, in the forms property sheet 
data section (when the form is in design view), I set the Data Entry to Yes.

Then in the vb, before the code for the combo box runs, simply insert Date 
Entry = False.

Has worked fine for me from Access 97, right up to 2007.

Daniel


"Tom Wickerath" <AOS168b AT comcast DOT net> wrote in message 
news:0E569607-4D80-471C-BE99-121E88984BD7@microsoft.com...
> No, Steve, the form will not display the record of interest. The reason is
> that the recordset contains no existing records. Try it out if you don't
> believe me.
>
>
> Tom Wickerath
> Microsoft Access MVP
> http://www.accessmvp.com/TWickerath/
> __________________________________________
>
> "Steve" wrote:
>
>> Hi Pierre,
>>
>> Add code to the open event of the form that opens the form to a new 
>> record.
>> Your form will then be blank. Then when you choose a record ftom the
>> combobox, the form will display that record.
>>
>> Steve
>> santus@penn.com
> 
0
Daniel
5/31/2010 10:28:46 AM
Hi Rick,

Thanks for your code, it works !

However, i do not use the DoCmd.OpenForm "FormName",,,"1 = 0" to open the 
form but instead, to get the form to open in a subform, i use ;

SubFormArea.SourceObject  = "Houses"

Any idea on how to adjest this code so it opens with a blank sheet ?
Thanks in advance,
Pierre

"Rick Brandt" <rickbrandt2@hotmail.com> wrote in message 
news:hu084p$i0s$1@news.eternal-september.org...
> Pierkes wrote:
>
>> Hi,
>>
>> I have a form on which i present al lot of data from a database.
>> On the form is a comobox which i use to select the right record en 
>> present
>> the data of this record on the form.
>>
>> When i open de form, de combobox is empty (which is good !) but the rest
>> of the form is already filled with the data of a record in the database
>> (which is not good). When i choose a record for the combobox, the form is
>> filled with the data of that particular record (which is good).
>>
>> So the only problem i have is on opening the form. Is it possible to open
>> the form without it being filled with data of a certain record (so is see
>> a blank form) ?
>>
>> Help will be much appreciated!
>
> Just open the form with a WHERE argument that has no records returned.
>
> DoCmd.OpenForm "FormName",,,"1 = 0"
>
> If you are using the bookmark method to show records with your ComboBox
> change that to applying a filter for the desired record.
>
> No need to mess with DataEntry mode or change Recordsets. 


0
Pierkes
5/31/2010 1:46:11 PM
Hi Rick,

I tried to reply to the group earlier but didn't see it appearing so here's 
another go...

Thanks for your code, it works !

However, i do not use the DoCmd.OpenForm "FormName",,,"1 = 0" to open the
form but instead, to get the form to open in a subform, i use ;

SubFormArea.SourceObject  = "Houses"

Any idea on how to adjest this code so it opens with a blank sheet ?
Thanks in advance,
Pierre


"Rick Brandt" <rickbrandt2@hotmail.com> wrote in message 
news:hu084p$i0s$1@news.eternal-september.org...
> Pierkes wrote:
>
>> Hi,
>>
>> I have a form on which i present al lot of data from a database.
>> On the form is a comobox which i use to select the right record en 
>> present
>> the data of this record on the form.
>>
>> When i open de form, de combobox is empty (which is good !) but the rest
>> of the form is already filled with the data of a record in the database
>> (which is not good). When i choose a record for the combobox, the form is
>> filled with the data of that particular record (which is good).
>>
>> So the only problem i have is on opening the form. Is it possible to open
>> the form without it being filled with data of a certain record (so is see
>> a blank form) ?
>>
>> Help will be much appreciated!
>
> Just open the form with a WHERE argument that has no records returned.
>
> DoCmd.OpenForm "FormName",,,"1 = 0"
>
> If you are using the bookmark method to show records with your ComboBox
> change that to applying a filter for the desired record.
>
> No need to mess with DataEntry mode or change Recordsets. 


0
Pierkes
5/31/2010 2:14:34 PM
Hi Rick,

Tried your code...

SubFormArea.SourceObject  = "Houses"
SubFormArea.Form.Filter = "1 = 0"
SubFormArea.Form.FilterOn = True

What happened was;

1 form loaded blank (which is good)
2 the form "blinked" (which is not good...)
3 using the combobox on the form does not result in changing the data on the 
form anymore (because the filter is on?)

Anuy ideas?
thanks,
Pierre


"Rick Brandt" <rickbrandt2@hotmail.com> wrote in message 
news:hu0i6q$739$1@news.eternal-september.org...
> Pierkes wrote:
>
>> Hi Rick,
>>
>> I tried to reply to the group earlier but didn't see it appearing so
>> here's another go...
>>
>> Thanks for your code, it works !
>>
>> However, i do not use the DoCmd.OpenForm "FormName",,,"1 = 0" to open the
>> form but instead, to get the form to open in a subform, i use ;
>>
>> SubFormArea.SourceObject  = "Houses"
>>
>> Any idea on how to adjest this code so it opens with a blank sheet ?
>> Thanks in advance,
>
> Well, that does change the parameters of the question quite a bit.  You
> could try...
>
> SubFormArea.SourceObject  = "Houses"
> SubFormArea.Form.Filter = "1 = 0"
> SubFormArea.Form.FilterOn = True
>
> ...but I'm not sure if that would first "blink" on a record before the
> filter is applied.
>
> If you are going to use a subform then you might be best to put the 
> ComboBox
> in the main form and use the MasterLink and ChildLink properties to do the
> filtering.  In that case as long as the main form starts out with a 
> ComboBox
> entry that has no match in the subform then you should get a blank subform
> until you change it. 


0
Pierkes
5/31/2010 3:02:30 PM
"Pierkes" <info@advisearch.nl> wrote in
news:4c02a554$0$15511$703f8584@news.kpn.nl: 

> So the only problem i have is on opening the form. Is it possible
> to open the form without it being filled with data of a certain
> record (so is see a blank form) ?

Use a recordsource like this, where "MyTable" is the smallest table
in your application, and the fieldnames are the fields controls on
the form are bound to: 

  SELECT TOP 1 Null As Field1, Null As Field2, Null As Field3 
  FROM MyTable

This gives you a single blank record that is uneditable. You would
then change the recordsource in the code that does the search. 

-- 
David W. Fenton                  http://www.dfenton.com/ 
usenet at dfenton dot com    http://www.dfenton.com/DFA/
0
David
5/31/2010 6:35:32 PM
Reply:

Similar Artilces:

deleting data, keep formulas
I want to delete the data in a worksheet, but keep the formulas so tha I have a worksheet pattern of formulas that I use frequently -- elviejo4 ----------------------------------------------------------------------- elviejo41's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=2356 View this thread: http://www.excelforum.com/showthread.php?threadid=39389 Cells.SpecialCells(xlCellTypeConstants, xlNumbers).ClearContents I don't know how large your spreadsheet is, but you could try changin the setting to display Formulas (Tools>Options | View tab, in th Win...

Rules Wizard does not open.
Hello all, I have a user that when he clicks the organize button and then when that expands out he trys to click the Rules Wizard button and nothing happens. Also Rules Wizard does not show up in the Tools menu. He is using Outlook 2002 SP-1. Does anyone have any clues? Thanks, Jay ...

Form type in a public folder
need to create a folder on a server and have been told I have more control over replication and where it is created if I use exchange manager. This seems to be true and fairly straightforward except I do not know how you create a folder to accept a particular type of form (e.g. Task). The point you do that when you create one in outlook is when you select "New" and you pick the form type from the drop down. I don't know if you can change the form type for an already exising folder. I do not mean the specific form type for a new item (eg ipm.task.custom form) I mean the general...

data validation #26
I have two cells in my spreadsheet where field personnel will enter data. I'm using Data Validation, Allow Date, to control what they enter. The cells are: A1 Year Begin A2 Proposed Year End They will put the year they began in the "Year Begin", but I want to limit what they can enter in "Proposed Year End" to no more than 12 years, that's the max we allow them to take. Under Data, I chose "between". For "Start date" I entered "1/1/2004", just so they don't erroneously type in previous years. For "End date", what do...

Filter of subfirm of sencond form
Hello all Expert I have write vba code to filter the subform but i can't as below -i have one form when click on button on this form show another form that have subform so i want to filter this subform but it is not working. can you help me how to do it working? Thanks. ...

Data analysis by 2-dimensional data table + database
Hello, in an old Excel-manual (possibly way back to version 3) by Microsoft there was an excellent example of a 2-dimensional datatable (in German: Mehrfachoperation) with input variables based on database results. Now I would need to apply this technique, but my old manual is lost, and I can't figure out by heart exactly how this was done. Does somebody still have an old manual from which to draw the model, or can let me know the deatils of the trick? Thank you in advance. Kind regards, H.G. Lamy H., I think that you are talking about a cross-tab table....

Exel 2002 freezes when opening sheet
Hi Have office XP, windows XP pro, latest service packs. When opening a word or exel document from the file/Open menu and select previous documents opened at the bottom of the menu the first time it takes forever and freezes the machine while waiting, after that it will open OK. Regards Grant ...

group & summarize diff rows of data that have something in common
I am trying to arrange a large amount of data (inventory) in 2 different ways. 1) Group all identical parts into one row and 2) Group all identical locations into one row. I dont know how to do this. I am dealing with over 3,000 rows. Any suggestions? Depending on your workbook layout, you may be able to use a pivot table to summarize the data. There are instructions in Excel's Help, and Jon Peltier has information and links: http://peltiertech.com/Excel/Pivots/pivotstart.htm pkunAAC wrote: > I am trying to arrange a large amount of data (inventory) in 2 different &g...

Dexterity Runtime: You do not have permissions to open this file
So, I have a users that is getting: "Dexterity Runtime: You do not have permissions to open this file" I checked and I ensured that she has the same permissions on the network as other users and she can get to all the files in the GP directory on the server. I had the admin reset her password in Great Plains and that didn't work either. I had one of the other users log into her computer and it worked fine too. Any Clues. Is this happening when first logging into GP? If so, it's typically a Windows permission error on the reports.dic (usually this happens when it...

Can a form with drop down menus search in other forms?
I am trying to design a database to where the switchboard will lead to a form that has various drop down menus for searching purposes. Let's say that on this form, one of the companies in the "Company Name" drop down menu is Company A. I want for Access to pull all forms that have "Company A" in it. So for example, I would end up with 1 record displayed out of 25. Is this even possible? -- Natasha Well, you really search WITH forms; you don't search FOR forms. Maybe this will help. http://datapigtechnologies.com/flashfiles/searchform.html ...

opening excel from intranet ie6.0
I have a number of excel files I wish to share between multiple users. I can give them access to these files via our Intranet using Internet Explorer 6.0. My problem is that the excel files open up inside the browser, not in excel. I want user to click on the file in the Intranet IE6.0 and for the file to open in the Excel application (Excel 2000). Any ideas / help welcome. Thanks Paddy ...

Excel messes my data up
Hi, I am trying to run vlookup for about 5K cells from range of 20k cells. Now the problem is that some of the cells include only numbers and some both numbers and letters, like AB11002. I also have empty spaces on the data so I have to run trim on both data before running vlookup. Just after trimming both data vlookup runs correctly, but if I "touch" any cell containing only numbers excel propably converts it to number and at this point excel don't think those two cells that before was equal are equal any more. So how in the earth I could convert my mixed data in the format e...

The disappearing form
In using Access 2007, I have a database with five joined tables. I want to make a form, based on the "main table" and then four individual subforms. This works fine for the first of the four subforms, but when I add the second in design view, and then look at my handy work in Form View, all I have is a blank, white display, none of the controls are visible. This is the most complex form I have ever attempted and can not determine what is wrong. Please help. Paul If your form is blank, that generally means there was no data there to show. Make sure your control sour...

How to update the data of a combo box
In a form I have tab pages One is for consultation data it is a subform link to consultation table. The other page is Examen subform in which you have a combo box that will list the consultations of a client. The problem is when I add a new consultaion record for a client it does not appear in the list. I have to select another client and then come back to the preveous client to see the new entry. For this combo I run Me.my_combo_box.requery on the current and load event. Somehow this does not refresh or update or ??? my list. What should I do ? Thank you. -- eric ...

Data Access Page 09-11-07
Good Morning Community, Is there any way to include a search function on a Data access Page? I have a file that I want to put on a Data access page that will be published on a shared drive, the problem is that the file has about 1000 records and to search through each one would defeat the purpose of putting the page up. Is there anyway to include a search function that would jump to a particular record as access does on its forms. Thanks in advance for any response Perhaps this sample database will serve as a starting point: http://www.cadellsoftware.org/SampleDBs.htm#FilterDAP...

BOM print in graphics mode missing data
We are using GP 8 SP 2. When we print a BOM in text mode, everything prints fine but it graphics mode, each page is missing several lines of data as if it expects the page to be longer than 11". Does anyone know of a fix for this? Thanks. ...

how do I link a text box on a chart to a specific data point?
I have a text box in a chart that I want to move with the data, as additional data is added to the chart. For instance, if the datapoint is January 5, 2008, as I add additional days, I want the text box associated with the January 5, 2008 datapoint to move with the graph. Hi, Text boxes don't track with the data. Replace the text box with a Data Label. Select a single point in a series that is near the location of the text box. Choose Format, Selected Data Point, on the Data Labels tab turn on Value. Click OK. Select the data label and type the text that was in the Text box. ...

Exchange 2003 Forms Logon
Hi there.... I am trying to have exchange 2003 view forms when using the webmail client to logon, I set it to use forms in exchange system manager, but upon login.... no forms :/ just a dialog box to logon... Can anyone help? thanks alot in advance Rudi Groenewald wrote: > Hi there.... > > I am trying to have exchange 2003 view forms when using the webmail > client to logon, I set it to use forms in exchange system manager, > but upon login.... no forms :/ just a dialog box to logon... > > > Can anyone help? I guess you mean Forms-based Authentication? Are you u...

Locking Fields in an Editable Form
Hello, I created a form that has the Allow Edits selected as Yes. But I only want 2 fields in the form to be editable, the remaining other fields I'd like them to be locked. Is there a way I can lock the other fields so that it's not changed? When I try to change the field property for Locked as Yes, it locks the field so that when I enter any new records it will not allow me to input data in that field. Can anyone suggest how I can modifiy my existing form so that it locks most of the fields after it's saved but allows edits to specific fields when going back on a record? Th...

Unable to open Exchange Systems Manager
When I double-click on the ESM on the desktop. I get the following error message. Error Message 1: The system cannot find the file specified Facility: Win32 ID no: c007002 Exchange System Manager Error Message 2: (This message appears after clicking on OK from message 1) Microsoft Visual C++ Runtime Library Runtime Error! Program: This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information. Running Exchange 2003 with Windows 2003 "=?Utf-8?B?TWlrZSBDaHVuZw==?=" <MikeChung@discussions.m...

Unable to open excel file #2
Hi. I have problem openning an excel file from windows explorer or from my desktop. However, when I open the excel program and open a file manually(File-Open----) everything works fine. I get an error message that the file could not be located. I noticed that it adds .xls to every word separated by space. For example: My file is in C:/Shared/Folder/test.xls, it tries to open: C:/Shared.xls then Folder.xls then test.xls Please help. Thanks. --- Message posted from http://www.ExcelForum.com/ Hi! I think the steps below will solve this problem: 1. Exit Excel 2. From the Startmenu, cli...

Open Puiblisher Document Without Program Installed
Is there a snap-in or some way to view a Publisher 2003 document without having the Publisher software installed? I know there is a viewer for Powerpoint slides and thought maybe there is something similiar for Publisher? I have done some searches and found nothing. Thanks in advance for any info. No, there isn't a Publisher viewer. Have your sender convert the publication to a PDF or a picture. There are free PDF converters around. You can download a trial version of Publisher 2007, when the trial runs out it will serve as a viewer. http://office.microsoft.com/en-us/publisher/FX...

Report Writer, Blank SOP Forms & MBoM Revision Levels
Hello, I am trying to add the revision level listed in table BM010415 of the Manufacturing Series to the Blank SOP Forms used in Dynamics GP. I am frustrated by the lack of capacity to relate GP Tables to Manufacturing Tables in the Report Writer. Can anyone offer any help? (Without using Modifier dependant VBA.) To go into further detail, I can link from the Manufacturing Series into standard GP tables; but I can't link from GP into Manufacturing, which forces the Manufacturing Tables to be primaries and inhibits the ability to reach into Manufacturing. I can add GP Data into...

unable to open information store
After a recent power failure, where the exchange server was not shut down properly and just died, I now have users, that used to be able to open other users inbox to read the emails, now not able to open these inboxes. the message is unable to open information store. The same also applies to callenders, but this is not happening to everyone, as I can still access other peoples folders. ...

Import XML data in Excel XP Professional
Hello all, I have a pretty well-formated XML data file and a well designed Excel file (.xls) served as my report template. I would like to import this XML data file into my Excel template. So, the Excel Template will do the Totals and subtotals of the XML data for me. How do I do so in Excel XP Professional version? Thank you sooooooo much~~~~ Annie .. ...