User Profile
Collapse
-
Try using the "After Insert" or "On Dirty" event for the form, as opposed to the field event.... -
I hope you get an answer to this. My NZ function has stopped working also, in spite of checking and resetting all my references. Now, in code, I have to explicitly check if a value is null and if so, set it to what would have been my NZ default. Don't know why.......Leave a comment:
-
Use the "report wizard" to help you build a subset containing all three queries.
Or, click and drag each query to a blank report in design view....Leave a comment:
-
You can reset the recordsource but sometimes Access gets "confused" or there are timing problems or recordlock conflicts.
After you reset the recordsource, you need to requery the recordset to make it work. This only works if the field names are exactly the same in both record sources. For most applications, this isn't the "normal" way of doing things, however....Leave a comment:
-
If I'm reading this correctly (and it is for a "dissertati on", not your homework) there is a logic flaw. For one thing, if your goal is to populate a combo box with available courses for the student to take, you would not be including the ones he/she already took, but would need to eliminate those.
You would be working with 3 tables: students, courses taken, and courses available.
Your first table would have...Leave a comment:
-
If you want it to be alphabetical, simply add a sort to the underlying query of your form.
Using a bound form like this, you could "clear" everything on startup by setting the default value of your UNBOUND combobox to this:
cboBoxName.item data(0)
then, bind your primary field in your recordset (in the underlying querygrid) to the combobox. When the form opens, the combo box will be set to nothing,...Leave a comment:
-
Google "data analysis" and "Ms Access." I came across some sharp code to do this yesterday, but don't remember where. I do recall that it was under "data analysis" though.Leave a comment:
-
This looks like SQL server syntax to me, not Access SQL. I'm not sure if Access can handle all the alias references. Also, there is a whack "/" at the end of your first line, which wouldn't work in Access.Leave a comment:
-
For fun, you can try using the "split" function like so:
dim myJoinedNames
dim NewNames
dim NewFirstName as string
dim NewLastName as string
myJoinedNames=m e.myField
NewNames = Split(myJoinedN ames, " ", -1) 'assumes a space break
newfirstname=ne wnames(0)
newlastname=new names(1)...Leave a comment:
-
Hey, your link didn't work and I'm really curious about this. Would you mind explaining the gist of it?...Leave a comment:
-
I should have added, another way to do it is this (first get your listbox value like in the last example):
dim curVal
dim rs as recordset
dim strsql as string
curval=myListBo x.value
strsql="Select * from myTable where myField = " & curVal & "
set rs= currentdb.openr ecordset(strsql )
if not rs.eof then
'go on
else
exit sub...Leave a comment:
-
Put this code in the onclick event of a button. You'll need to change the names to match your field name, your tablename and your listboxname. Be sure the field you reference in your table is the same field that is contained in your listbox.
Dim curLstVal
dim strSql as string
curLstVal= me.mylistboxnam e
strSql = "Delete from tblMyTable where fldMyfield = " & curLstVal & "...Leave a comment:
-
The field name must be in the dataset behind the form and on the form itself to be "seen" in your code. Is it there? Also, perhaps an easier way to pull this off is to parameterize your report query and reference the field on your form. To open the report, you'll only need the line you have to open the report as the filter will be "built in" to the query behind the report....Leave a comment:
-
What is the whack "/" after "strudent_enrol l on the first line? Also, usually when you get a prompt for a parameter like that, it's because you've misspelled a word in the string. Do you really have a field named "strudent"? Next to this, I'd suggest pulling the fields into a query grid to get the SQL straight for Access as its version of SQL can be a little different than ANSI....Leave a comment:
-
Do you want the record numbers to be automatically generated too? If so, you would add that into a COMPOSITE key. This is how:
First, in your table, setup a key called (for example) fldRecordNum with a type of Autonumber. Next, setup a key called fldType as a string data type and another called fldYear that is an integer. You then click on the outer left bar to highlight all three at once and click the little key in the toolbar that indicates...Leave a comment:
-
Hi Joe,
I didn't have anything set under startup except for an icon. Would that be enough to cause this? Today when I opened, it halted during the load event of the second form. No explanation, no error. I keyed F5 and it just continued like it should have done to start with.
Ideas?
Thanks...Leave a comment:
-
Thanks for the quick response. I didn't even look under the startup properties as I'm setting up the db properties for the session using code rather than manually. I've used this same code numerous times with other databases and never had a problem, but this is the first time I've used version 2003, so I wonder if it has to do with that? I'm too tired to look this up tonight (or this morning), but thanks for the tip. I'll check it out....Leave a comment:
-
You would need to setup some variables to hold the values before you deleted them. You would pull these items using a select statement, then set the values. For example:
Dim strSql as string
Dim rs as recordset
Dim iItem as integer
dim sItemDef as string
dim strsql2 as string
strSql-"Select * from mytable where fldItemID = " & YourItemID & "
set rs=currentdb.op enrecordset(str sql)...Leave a comment:
-
Auto Exec macro hangs after compact/repair
I noticed that after running compact/repair, I have to recompile my code for the program not to break the next time I open it. What happens is the auto exec macro runs the main() module, then hangs with the second line of code highlighted. No error message, just hangs. If I stop it and recompile the code, it runs again. Does anyone know anything about this? Is there some way to run something to recompile the code automatically after compacting so...
No activity results to display
Show More
Leave a comment: